org.jboss.webbeans.introspector.jlr
Class AnnotatedFieldImpl<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.Field>
          extended by org.jboss.webbeans.introspector.jlr.AnnotatedFieldImpl<T>
Type Parameters:
T -
All Implemented Interfaces:
AnnotatedField<T>, AnnotatedItem<T,java.lang.reflect.Field>

public class AnnotatedFieldImpl<T>
extends AbstractAnnotatedMember<T,java.lang.reflect.Field>
implements AnnotatedField<T>

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

Author:
Pete Muir

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember
AbstractAnnotatedMember.AnnotatedParameterMap
 
Nested classes/interfaces inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem
AbstractAnnotatedItem.AnnotationMap
 
Field Summary
 
Fields inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
MAPPED_METAANNOTATIONS
 
Constructor Summary
AnnotatedFieldImpl(java.lang.reflect.Field field, AnnotatedType<?> declaringClass)
          Constructor Initializes the superclass with the built annotation map and detects the type arguments
 
Method Summary
 T get(java.lang.Object instance)
          Injects an instance
 java.lang.reflect.Type[] getActualTypeArguments()
          Gets the actual type arguments
 java.lang.reflect.Field getAnnotatedField()
          Gets the underlying field
 AnnotatedType<?> getDeclaringClass()
          Gets the abstracted declaring class
 java.lang.reflect.Field getDelegate()
           
 java.lang.String getPropertyName()
          Gets the property name
 java.lang.Class<T> getType()
          Gets the type
 void inject(java.lang.Object instance, Manager manager)
          Gets the current value and injects this instance into an instance
 void injectIntoInstance(java.lang.Object instance, Manager manager)
          Injects an instance
 java.lang.String toDetailedString()
           
 java.lang.String toString()
          Gets a string representation of the field
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedMember
getName, getValue, isFinal, isStatic
 
Methods inherited from class org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem
buildAnnotationMap, buildAnnotationMap, equals, getAnnotation, getAnnotationMap, getAnnotations, getBindingTypes, getBindingTypesAsArray, getMetaAnnotations, getMetaAnnotationsAsArray, getParameterValues, getParameterValues, hashCode, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isProxyable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.webbeans.introspector.AnnotatedItem
getAnnotation, getAnnotations, getBindingTypes, getBindingTypesAsArray, getMetaAnnotations, getMetaAnnotationsAsArray, getName, isAnnotationPresent, isAssignableFrom, isAssignableFrom, isFinal, isProxyable, isStatic
 

Constructor Detail

AnnotatedFieldImpl

public AnnotatedFieldImpl(java.lang.reflect.Field field,
                          AnnotatedType<?> declaringClass)
Constructor Initializes the superclass with the built annotation map and detects the type arguments

Parameters:
field - The actual field
declaringClass - The abstraction of the declaring class
Method Detail

getAnnotatedField

public java.lang.reflect.Field getAnnotatedField()
Gets the underlying field

Specified by:
getAnnotatedField in interface AnnotatedField<T>
Returns:
The fields

getDelegate

public java.lang.reflect.Field getDelegate()
Specified by:
getDelegate in class AbstractAnnotatedItem<T,java.lang.reflect.Field>

getType

public java.lang.Class<T> getType()
Gets the type

Specified by:
getType in interface AnnotatedItem<T,java.lang.reflect.Field>
Returns:
The type

getActualTypeArguments

public java.lang.reflect.Type[] getActualTypeArguments()
Gets the actual type arguments

Specified by:
getActualTypeArguments in interface AnnotatedItem<T,java.lang.reflect.Field>
Returns:
The type arguments
See Also:
AnnotatedItem.getActualTypeArguments()

inject

public void inject(java.lang.Object instance,
                   Manager manager)
Gets the current value and injects this instance into an instance

Specified by:
inject in interface AnnotatedField<T>
Parameters:
instance - The instance to inject into
manager - The Web Beans manager
See Also:
AnnotatedField.inject(Object, Manager)

injectIntoInstance

public void injectIntoInstance(java.lang.Object instance,
                               Manager manager)
Description copied from interface: AnnotatedField
Injects an instance

Specified by:
injectIntoInstance in interface AnnotatedField<T>
Parameters:
instance - The instance to inject
manager - The Web Beans manager

get

public T get(java.lang.Object instance)
Description copied from interface: AnnotatedField
Injects an instance

Specified by:
get in interface AnnotatedField<T>
Parameters:
instance - The instance to inject

getPropertyName

public java.lang.String getPropertyName()
Gets the property name

Specified by:
getPropertyName in interface AnnotatedField<T>
Returns:
The property name
See Also:
AnnotatedItem.getName()

getDeclaringClass

public AnnotatedType<?> getDeclaringClass()
Gets the abstracted declaring class

Specified by:
getDeclaringClass in interface AnnotatedField<T>
Returns:
The declaring class
See Also:
AnnotatedField.getDeclaringClass()

toString

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

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

toDetailedString

public java.lang.String toDetailedString()
Overrides:
toDetailedString in class AbstractAnnotatedMember<T,java.lang.reflect.Field>


Copyright © 2008. All Rights Reserved.