Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 1 | /* |
| 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 Ziegeler | 9452bb2 | 2012-06-13 13:08:05 +0000 | [diff] [blame] | 19 | package org.apache.felix.scrplugin.annotations; |
Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 20 | |
| 21 | import java.lang.reflect.Method; |
| 22 | import java.util.Map; |
| 23 | |
Carsten Ziegeler | 9452bb2 | 2012-06-13 13:08:05 +0000 | [diff] [blame] | 24 | /** |
| 25 | * A method annotation |
| 26 | */ |
Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 27 | public class MethodAnnotation extends ScannedAnnotation { |
| 28 | |
Carsten Ziegeler | 9452bb2 | 2012-06-13 13:08:05 +0000 | [diff] [blame] | 29 | /** The annotated method. */ |
Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 30 | private final Method method; |
| 31 | |
Carsten Ziegeler | 9452bb2 | 2012-06-13 13:08:05 +0000 | [diff] [blame] | 32 | /** |
| 33 | * Constructor |
| 34 | */ |
Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 35 | public MethodAnnotation(final String name, final Map<String, Object> values, final Method m) { |
| 36 | super(name, values); |
| 37 | this.method = m; |
| 38 | } |
| 39 | |
Carsten Ziegeler | 9452bb2 | 2012-06-13 13:08:05 +0000 | [diff] [blame] | 40 | /** |
| 41 | * Get the annotated method. |
| 42 | */ |
Carsten Ziegeler | 55c96d3 | 2012-06-13 12:03:35 +0000 | [diff] [blame] | 43 | 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 | } |