org.jboss.webbeans.introspector.jlr
Class AnnotatedConstructorImpl<T>

java.lang.Object
  extended by org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem<T,S>
      extended by org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember<T,java.lang.reflect.Constructor<T>>
          extended by org.jboss.webbeans.introspector.jlr.AnnotatedConstructorImpl<T>
Type Parameters:
T -
All Implemented Interfaces:
AnnotatedConstructor<T>, AnnotatedItem<T,java.lang.reflect.Constructor<T>>, AnnotatedMember<T,java.lang.reflect.Constructor<T>>

public class AnnotatedConstructorImpl<T>
extends AbstractAnnotatedMember<T,java.lang.reflect.Constructor<T>>
implements AnnotatedConstructor<T>

Represents an annotated constructor This class is immutable, and therefore threadsafe

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Constructor Summary
protected AnnotatedConstructorImpl(java.lang.reflect.Constructor<T> constructor, AnnotatedType<T> declaringClass)
          Constructor Initializes the superclass with the build annotations map
 
Method Summary
 boolean equals(java.lang.Object other)
          The overridden equals operation
 java.lang.reflect.Constructor<T> getAnnotatedConstructor()
          Gets the constructor
 java.util.List<AnnotatedParameter<?>> getAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
          Gets parameter abstractions with a given annotation type.
 AnnotatedType<T> getDeclaringClass()
          Gets the declaring class
 java.lang.reflect.Constructor<T> getDelegate()
          Gets the delegate (constructor)
 java.util.List<AnnotatedParameter<?>> getParameters()
          Gets the abstracted parameters If the parameters are null, initalize them first
 ConstructorSignature getSignature()
           
 int hashCode()
          The overridden hashcode Gets the hash code from the delegate
 T newInstance(java.lang.Object... parameters)
          Creates a new instance
static
<T> AnnotatedConstructor<T>
of(java.lang.reflect.Constructor<T> constructor, AnnotatedType<T> declaringClass)
           
 java.lang.String toString()
          Gets a string representation of the constructor
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember
getMember, getName, getValue, isFinal, isPublic, isStatic, isTransient
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem
getActualTypeArguments, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindings, getBindingsAsArray, getDeclaredMetaAnnotations, getFlattenedTypeHierarchy, getMetaAnnotations, getMetaAnnotationsAsArray, getRawType, getType, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isParameterizedType, isProxyable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedMember
getMember
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
getActualTypeArguments, getAnnotation, getAnnotationsAsSet, getAnnotationStore, getBindings, getBindingsAsArray, getDeclaredMetaAnnotations, getFlattenedTypeHierarchy, getMetaAnnotations, getMetaAnnotationsAsArray, getName, getRawType, getType, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isDeclaredAnnotationPresent, isFinal, isParameterizedType, isProxyable, isPublic, isStatic
 

Constructor Detail

AnnotatedConstructorImpl

protected AnnotatedConstructorImpl(java.lang.reflect.Constructor<T> constructor,
                                   AnnotatedType<T> declaringClass)
Constructor Initializes the superclass with the build annotations map

Parameters:
constructor - The constructor method
declaringClass - The declaring class
Method Detail

of

public static <T> AnnotatedConstructor<T> of(java.lang.reflect.Constructor<T> constructor,
                                             AnnotatedType<T> declaringClass)

getAnnotatedConstructor

public java.lang.reflect.Constructor<T> getAnnotatedConstructor()
Gets the constructor

Returns:
The constructor

getDelegate

public java.lang.reflect.Constructor<T> getDelegate()
Gets the delegate (constructor)

Specified by:
getDelegate in class AbstractAnnotatedItem<T,java.lang.reflect.Constructor<T>>
Returns:
The delegate

getParameters

public java.util.List<AnnotatedParameter<?>> getParameters()
Gets the abstracted parameters If the parameters are null, initalize them first

Specified by:
getParameters in interface AnnotatedConstructor<T>
Returns:
A list of annotated parameter abstractions
See Also:
AnnotatedConstructor.getParameters()

getAnnotatedParameters

public java.util.List<AnnotatedParameter<?>> getAnnotatedParameters(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Gets parameter abstractions with a given annotation type. If the parameters are null, they are initializes first.

Specified by:
getAnnotatedParameters in interface AnnotatedConstructor<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:
AnnotatedConstructor.getAnnotatedParameters(Class)

newInstance

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

Specified by:
newInstance in interface AnnotatedConstructor<T>
Parameters:
manager - The Web Beans manager
Returns:
An instance
Throws:
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.IllegalArgumentException
See Also:
org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(ManagerImpl)

equals

public boolean equals(java.lang.Object other)
The overridden equals operation

Overrides:
equals in class AbstractAnnotatedItem<T,java.lang.reflect.Constructor<T>>
Parameters:
other - The instance to compare to
Returns:
True if equal, false otherwise

hashCode

public int hashCode()
The overridden hashcode Gets the hash code from the delegate

Overrides:
hashCode in class AbstractAnnotatedItem<T,java.lang.reflect.Constructor<T>>
Returns:
The hash code

getDeclaringClass

public AnnotatedType<T> getDeclaringClass()
Gets the declaring class

Specified by:
getDeclaringClass in interface AnnotatedConstructor<T>
Specified by:
getDeclaringClass in interface AnnotatedMember<T,java.lang.reflect.Constructor<T>>
Returns:
The declaring class

toString

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

Overrides:
toString in class AbstractAnnotatedMember<T,java.lang.reflect.Constructor<T>>
Returns:
A string representation

getSignature

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


Copyright © 2011. All Rights Reserved.