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.Type; 17 18 import javax.enterprise.inject.spi.AnnotatedCallable; 19 import javax.enterprise.inject.spi.AnnotatedParameter; 20 21 /** 22 * Implementation of {@link AnnotatedParameter} interface. 23 * 24 * @version $Rev: 788940 $ $Date: 2009-06-27 11:52:08 +0300 (Sat, 27 Jun 2009) $ 25 * 26 * @param <X> declaring class info 27 */ 28 class AnnotatedParameterImpl<X> extends AbstractAnnotated implements AnnotatedParameter<X> 29 { 30 /**Declaring callable*/ 31 private AnnotatedCallable<X> declaringCallable; 32 33 /**Parameter position*/ 34 private int position; 35 36 AnnotatedParameterImpl(Type baseType, AnnotatedCallable<X> declaringCallable, int position) 37 { 38 super(baseType); 39 this.declaringCallable = declaringCallable; 40 this.position = position; 41 } 42 43 /** 44 * {@inheritDoc} 45 */ 46 @Override 47 public AnnotatedCallable<X> getDeclaringCallable() 48 { 49 return this.declaringCallable; 50 } 51 52 /** 53 * {@inheritDoc} 54 */ 55 @Override 56 public int getPosition() 57 { 58 return this.position; 59 } 60 61 public String toString() 62 { 63 StringBuilder builder = new StringBuilder(); 64 builder.append("Annotated Parameter"); 65 builder.append(","); 66 builder.append(super.toString()+ ","); 67 builder.append("Annotated Callable : [" + this.declaringCallable.toString() + "],"); 68 builder.append("Position : " + position); 69 70 return builder.toString(); 71 } 72 }