blob: f55542125a2198ef8731b2fbebc657159fe78fd5 [file] [log] [blame]
Carsten Ziegeler55c96d32012-06-13 12:03:35 +00001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
Carsten Ziegeler9452bb22012-06-13 13:08:05 +000019package org.apache.felix.scrplugin.annotations;
Carsten Ziegeler55c96d32012-06-13 12:03:35 +000020
21import java.lang.reflect.Method;
22import java.util.Map;
23
Carsten Ziegeler9452bb22012-06-13 13:08:05 +000024/**
25 * A method annotation
26 */
Carsten Ziegeler55c96d32012-06-13 12:03:35 +000027public class MethodAnnotation extends ScannedAnnotation {
28
Carsten Ziegeler9452bb22012-06-13 13:08:05 +000029 /** The annotated method. */
Carsten Ziegeler55c96d32012-06-13 12:03:35 +000030 private final Method method;
31
Carsten Ziegeler9452bb22012-06-13 13:08:05 +000032 /**
33 * Constructor
34 */
Carsten Ziegeler55c96d32012-06-13 12:03:35 +000035 public MethodAnnotation(final String name, final Map<String, Object> values, final Method m) {
36 super(name, values);
37 this.method = m;
38 }
39
Carsten Ziegeler9452bb22012-06-13 13:08:05 +000040 /**
41 * Get the annotated method.
42 */
Carsten Ziegeler55c96d32012-06-13 12:03:35 +000043 public Method getAnnotatedMethod() {
44 return this.method;
45 }
46
47 @Override
48 public String toString() {
49 return "MethodAnnotationDescription [name=" + name + ", values="
50 + values + ", method=" + method + "]";
51 }
52}