1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the NOTICE file distributed with this 4 * work for additional information regarding copyright ownership. The ASF 5 * licenses this file to You under the Apache License, Version 2.0 (the 6 * "License"); you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law 9 * or agreed to in writing, software distributed under the License is 10 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 11 * KIND, either express or implied. See the License for the specific language 12 * governing permissions and limitations under the License. 13 */ 14 package org.apache.webbeans.portable; 15 16 import java.lang.reflect.Method; 17 18 import javax.enterprise.inject.spi.AnnotatedMethod; 19 import javax.enterprise.inject.spi.AnnotatedType; 20 21 /** 22 * Implementation of {@link AnnotatedMethod} interface. 23 * 24 * @version $Rev: 788970 $ $Date: 2009-06-27 16:26:23 +0300 (Sat, 27 Jun 2009) $ 25 * 26 * @param <X> class info 27 */ 28 class AnnotatedMethodImpl<X> extends AbstractAnnotatedCallable<X> implements AnnotatedMethod<X> 29 { 30 31 /** 32 * Create a ew instance. 33 * 34 * @param baseType base type info 35 * @param javaMember method 36 */ 37 AnnotatedMethodImpl(Method javaMember) 38 { 39 this(javaMember, null); 40 } 41 42 /** 43 * Create a ew instance. 44 * 45 * @param baseType base type info 46 * @param declaringType declaring type 47 * @param javaMember method 48 */ 49 AnnotatedMethodImpl(Method javaMember,AnnotatedType<X> declaringType) 50 { 51 super(javaMember.getGenericReturnType(), javaMember,declaringType); 52 setAnnotations(javaMember.getDeclaredAnnotations()); 53 setAnnotatedParameters(javaMember.getGenericParameterTypes(), javaMember.getParameterAnnotations()); 54 } 55 56 57 /** 58 * {@inheritDoc} 59 */ 60 public Method getJavaMember() 61 { 62 return Method.class.cast(this.javaMember); 63 } 64 65 public String toString() 66 { 67 StringBuilder builder = new StringBuilder(); 68 builder.append("Annotated Method,"); 69 builder.append(super.toString()); 70 71 return builder.toString(); 72 } 73 74 }