org.jboss.weld.introspector.jlr
Class WeldFieldImpl<T,X>

java.lang.Object
  extended by org.jboss.weld.introspector.jlr.AbstractWeldAnnotated<T,S>
      extended by org.jboss.weld.introspector.jlr.AbstractWeldMember<T,X,Field>
          extended by org.jboss.weld.introspector.jlr.WeldFieldImpl<T,X>
Type Parameters:
T -
All Implemented Interfaces:
javax.enterprise.inject.spi.Annotated, javax.enterprise.inject.spi.AnnotatedField<X>, javax.enterprise.inject.spi.AnnotatedMember<X>, WeldAnnotated<T,Field>, WeldField<T,X>, WeldMember<T,X,Field>

public class WeldFieldImpl<T,X>
extends AbstractWeldMember<T,X,Field>
implements WeldField<T,X>

Represents an annotated field

This class is immutable, and therefore threadsafe

Author:
Pete Muir

Field Summary
 
Fields inherited from interface org.jboss.weld.introspector.WeldAnnotated
MAPPED_DECLARED_METAANNOTATIONS, MAPPED_METAANNOTATIONS
 
Method Summary
 T get(Object instance)
           
 Field getAnnotatedField()
          Gets the underlying field
 Field getDelegate()
           
 String getPropertyName()
          Gets the property name
 boolean isGeneric()
           
static
<X> WeldFieldImpl<?,X>
of(javax.enterprise.inject.spi.AnnotatedField<? super X> annotatedField, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
static
<T,X> WeldFieldImpl<T,X>
of(Field field, WeldClass<X> declaringClass, ClassTransformer classTransformer)
           
 void set(Object instance, Object value)
          Injects an instance
 void setOnInstance(Object instance, Object value)
           
 String toString()
          Gets a string representation of the field
 
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, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.weld.introspector.WeldField
isTransient
 
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.AnnotatedField
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,X> WeldFieldImpl<T,X> of(Field field,
                                          WeldClass<X> declaringClass,
                                          ClassTransformer classTransformer)

of

public static <X> WeldFieldImpl<?,X> of(javax.enterprise.inject.spi.AnnotatedField<? super X> annotatedField,
                                        WeldClass<X> declaringClass,
                                        ClassTransformer classTransformer)

getAnnotatedField

public Field getAnnotatedField()
Gets the underlying field

Returns:
The fields

getDelegate

public Field getDelegate()
Specified by:
getDelegate in class AbstractWeldAnnotated<T,Field>

set

public void set(Object instance,
                Object value)
         throws IllegalArgumentException,
                IllegalAccessException
Description copied from interface: WeldField
Injects an instance

Specified by:
set in interface WeldField<T,X>
Parameters:
instance - The instance to inject into
value - The value to inject
Throws:
IllegalArgumentException
IllegalAccessException

setOnInstance

public void setOnInstance(Object instance,
                          Object value)
                   throws IllegalArgumentException,
                          SecurityException,
                          IllegalAccessException,
                          NoSuchFieldException
Throws:
IllegalArgumentException
SecurityException
IllegalAccessException
NoSuchFieldException

get

public T get(Object instance)
Specified by:
get in interface WeldField<T,X>

getPropertyName

public String getPropertyName()
Gets the property name

Specified by:
getPropertyName in interface WeldField<T,X>
Returns:
The property name
See Also:
WeldAnnotated.getName()

toString

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

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

isGeneric

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


Copyright © 2013 Seam Framework. All Rights Reserved.