org.jboss.weld.introspector.jlr
Class WeldConstructorImpl<T>

java.lang.Object
  extended by org.jboss.weld.introspector.jlr.AbstractWeldAnnotated<T,S>
      extended by org.jboss.weld.introspector.jlr.AbstractWeldMember<T,X,S>
          extended by org.jboss.weld.introspector.jlr.AbstractWeldCallable<T,T,Constructor<T>>
              extended by org.jboss.weld.introspector.jlr.WeldConstructorImpl<T>
Type Parameters:
T - exact type
All Implemented Interfaces:
javax.enterprise.inject.spi.Annotated, javax.enterprise.inject.spi.AnnotatedCallable<T>, javax.enterprise.inject.spi.AnnotatedConstructor<T>, javax.enterprise.inject.spi.AnnotatedMember<T>, WeldAnnotated<T,Constructor<T>>, WeldCallable<T,T,Constructor<T>>, WeldConstructor<T>, WeldMember<T,T,Constructor<T>>

public class WeldConstructorImpl<T>
extends AbstractWeldCallable<T,T,Constructor<T>>
implements WeldConstructor<T>

Represents an annotated constructor

This class is immutable, and therefore threadsafe

Author:
Pete Muir, Ales Justin, Marko Luksa

Field Summary
 
Fields inherited from interface org.jboss.weld.introspector.WeldCallable
MAPPED_PARAMETER_ANNOTATIONS
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS
 
Method Summary
 boolean equals(Object other)
          The overridden equals operation
 Constructor<T> getAnnotatedConstructor()
          Gets the constructor
 Constructor<T> getDelegate()
          Gets the delegate (constructor)
 List<javax.enterprise.inject.spi.AnnotatedParameter<T>> getParameters()
           
 ConstructorSignature getSignature()
           
 List<WeldParameter<?,T>> getWeldParameters()
          Gets the abstracted parameters

If the parameters are null, initalize them first

 List<WeldParameter<?,T>> getWeldParameters(Class<? extends Annotation> annotationType)
          Gets parameter abstractions with a given annotation type.
 int hashCode()
           
 boolean isGeneric()
           
 T newInstance(Object... parameters)
          Creates a new instance
static
<T> WeldConstructor<T>
of(javax.enterprise.inject.spi.AnnotatedConstructor<T> annotatedConstructor, WeldClass<T> declaringClass, ClassTransformer classTransformer)
           
static
<T> WeldConstructor<T>
of(Constructor<T> constructor, WeldClass<T> declaringClass, ClassTransformer classTransformer)
           
 String toString()
          Gets a string representation of the constructor
 
Methods inherited from class org.jboss.weld.introspector.jlr.AbstractWeldMember
getDeclaringType, getJavaMember, getName, getPackage, isFinal, isPackagePrivate, isPrivate, isPublic, isStatic, isTransient
 
Methods inherited from class org.jboss.weld.introspector.jlr.AbstractWeldAnnotated
addMetaAnnotations, addMetaAnnotations, buildAnnotationMap, buildAnnotationMap, getActualTypeArguments, getAnnotation, getAnnotations, getBaseType, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getQualifiers, getTypeClosure, isAnnotationPresent, isParameterizedType, isPrimitive
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldMember
getDeclaringType
 
Methods inherited from interface org.jboss.weld.introspector.WeldAnnotated
getActualTypeArguments, getBindingsAsArray, getInterfaceClosure, getJavaClass, getMetaAnnotations, getName, getPackage, getQualifiers, isFinal, isPackagePrivate, isParameterizedType, isPrimitive, isPrivate, isPublic, isStatic
 
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedConstructor
getJavaMember
 
Methods inherited from interface javax.enterprise.inject.spi.AnnotatedMember
isStatic
 
Methods inherited from interface javax.enterprise.inject.spi.Annotated
getAnnotation, getAnnotations, getBaseType, getTypeClosure, isAnnotationPresent
 

Method Detail

of

public static <T> WeldConstructor<T> of(Constructor<T> constructor,
                                        WeldClass<T> declaringClass,
                                        ClassTransformer classTransformer)

of

public static <T> WeldConstructor<T> of(javax.enterprise.inject.spi.AnnotatedConstructor<T> annotatedConstructor,
                                        WeldClass<T> declaringClass,
                                        ClassTransformer classTransformer)

getAnnotatedConstructor

public Constructor<T> getAnnotatedConstructor()
Gets the constructor

Returns:
The constructor

getDelegate

public Constructor<T> getDelegate()
Gets the delegate (constructor)

Specified by:
getDelegate in class AbstractWeldAnnotated<T,Constructor<T>>
Returns:
The delegate

getWeldParameters

public List<WeldParameter<?,T>> getWeldParameters()
Gets the abstracted parameters

If the parameters are null, initalize them first

Specified by:
getWeldParameters in interface WeldCallable<T,T,Constructor<T>>
Returns:
A list of annotated parameter abstractions
See Also:
WeldCallable.getWeldParameters()

getWeldParameters

public List<WeldParameter<?,T>> getWeldParameters(Class<? extends Annotation> annotationType)
Gets parameter abstractions with a given annotation type.

If the parameters are null, they are initializes first.

The results of the method are not cached, as it is not called at runtime

Specified by:
getWeldParameters in interface WeldCallable<T,T,Constructor<T>>
Parameters:
annotationType - The annotation type to match
Returns:
A list of matching parameter abstractions. An empty list is returned if there are no matches.
See Also:
WeldCallable.getWeldParameters(Class)

newInstance

public T newInstance(Object... parameters)
              throws IllegalArgumentException,
                     InstantiationException,
                     IllegalAccessException,
                     InvocationTargetException
Creates a new instance

Specified by:
newInstance in interface WeldConstructor<T>
Parameters:
parameters - the parameters
Returns:
An instance
Throws:
InvocationTargetException
IllegalAccessException
InstantiationException
IllegalArgumentException
See Also:
WeldConstructor.newInstance(Object... params)

equals

public boolean equals(Object other)
The overridden equals operation

Overrides:
equals in class Object
Parameters:
other - The instance to compare to
Returns:
True if equal, false otherwise

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Gets a string representation of the constructor

Overrides:
toString in class AbstractWeldMember<T,T,Constructor<T>>
Returns:
A string representation

getSignature

public ConstructorSignature getSignature()
Specified by:
getSignature in interface WeldConstructor<T>

getParameters

public List<javax.enterprise.inject.spi.AnnotatedParameter<T>> getParameters()
Specified by:
getParameters in interface javax.enterprise.inject.spi.AnnotatedCallable<T>

isGeneric

public boolean isGeneric()
Specified by:
isGeneric in interface WeldAnnotated<T,Constructor<T>>


Copyright © 2013 Seam Framework. All Rights Reserved.