Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.portable » [javadoc | source]

    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.Constructor;
   17   
   18   import javax.enterprise.inject.spi.AnnotatedConstructor;
   19   import javax.enterprise.inject.spi.AnnotatedType;
   20   
   21   /**
   22    * Implementation of {@link AnnotatedConstructor} 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 AnnotatedConstructorImpl<X> extends AbstractAnnotatedCallable<X> implements AnnotatedConstructor<X>
   29   {
   30       /**
   31        * Create a ew instance.
   32        * 
   33        * @param baseType base type info
   34        * @param javaMember constructor
   35        */
   36       AnnotatedConstructorImpl(Constructor<X> javaMember)
   37       {
   38           this(javaMember, null);
   39       }
   40       
   41       /**
   42        * Create a ew instance.
   43        * 
   44        * @param baseType base type info
   45        * @param javaMember constructor
   46        */
   47       AnnotatedConstructorImpl(Constructor<X> javaMember, AnnotatedType<X> declaringType)
   48       {        
   49           super(javaMember.getDeclaringClass(), javaMember, declaringType);
   50           setAnnotations(javaMember.getDeclaredAnnotations());
   51           setAnnotatedParameters(javaMember.getGenericParameterTypes(), javaMember.getParameterAnnotations());
   52       }
   53       
   54       
   55       /**
   56        * {@inheritDoc}
   57        */
   58       @SuppressWarnings("unchecked")
   59       public Constructor<X> getJavaMember()
   60       {
   61           return Constructor.class.cast(this.javaMember);
   62       }
   63       
   64       public String toString()
   65       {
   66           StringBuilder builder = new StringBuilder();
   67           builder.append("Annotated Constructor,");
   68           builder.append(super.toString());
   69           
   70           return builder.toString();
   71       }
   72   
   73   }

Home » apache-openwebbeans-1.0.0-incubating-M3-sources » org.apache.webbeans.portable » [javadoc | source]