JBoss Reflection 2.2.1.SP1

org.jboss.reflect.plugins
Class FieldInfoImpl

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.plugins.AbstractAnnotatedInfo
          extended by org.jboss.reflect.plugins.AnnotationHolder
              extended by org.jboss.reflect.plugins.FieldInfoImpl
All Implemented Interfaces:
Serializable, Cloneable, AnnotatedInfo, FieldInfo, MemberInfo, ModifierInfo, org.jboss.util.JBossInterface
Direct Known Subclasses:
ReflectFieldInfoImpl

public class FieldInfoImpl
extends AnnotationHolder
implements FieldInfo

A field info

Author:
Bill Burke, Adrian Brock
See Also:
Serialized Form

Field Summary
protected  ClassInfo declaringClass
          The declaring class
protected  int hash
          The hash code
protected  int modifiers
          The field modifier
protected  String name
          The field name
protected  TypeInfo type
          The field type
 
Fields inherited from class org.jboss.reflect.plugins.AnnotationHolder
annotationMap, annotationsArray
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.reflect.spi.ModifierInfo
ABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC
 
Constructor Summary
FieldInfoImpl()
          Create a new field info
FieldInfoImpl(AnnotationValue[] annotations, String name, TypeInfo type, int modifiers, ClassInfo declaring)
          Create a new FieldInfo.
 
Method Summary
protected  void calculateHash()
          Calculate the hash code
 boolean equals(Object obj)
           
 Object get(Object target)
          Get the value of the field
 ClassInfo getDeclaringClass()
          Get the declaring class
 int getModifiers()
          Get the modifiers
 String getName()
          Get the name
 TypeInfo getType()
          Get the field type
 int hashCode()
           
 boolean isPublic()
           
 boolean isStatic()
          Whether it is static
 boolean isVolatile()
          Whether it is volatile
 Object set(Object target, Object value)
          Set the value of the field
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
 
Methods inherited from class org.jboss.reflect.plugins.AnnotationHolder
getAnnotation, getAnnotations, isAnnotationPresent, setupAnnotations
 
Methods inherited from class org.jboss.reflect.plugins.AbstractAnnotatedInfo
getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toShortString, toShortString, toString, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.reflect.spi.AnnotatedInfo
getAnnotation, getAnnotations, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresent
 
Methods inherited from interface org.jboss.util.JBossInterface
clone, toShortString, toShortString
 

Field Detail

name

protected String name
The field name


type

protected TypeInfo type
The field type


modifiers

protected int modifiers
The field modifier


declaringClass

protected ClassInfo declaringClass
The declaring class


hash

protected int hash
The hash code

Constructor Detail

FieldInfoImpl

public FieldInfoImpl()
Create a new field info


FieldInfoImpl

public FieldInfoImpl(AnnotationValue[] annotations,
                     String name,
                     TypeInfo type,
                     int modifiers,
                     ClassInfo declaring)
Create a new FieldInfo.

Parameters:
annotations - the annotations
name - the name
type - the field type
modifiers - the field modifiers
declaring - the declaring class
Method Detail

getName

public String getName()
Description copied from interface: FieldInfo
Get the name

Specified by:
getName in interface FieldInfo
Returns:
the field name

getType

public TypeInfo getType()
Description copied from interface: FieldInfo
Get the field type

Specified by:
getType in interface FieldInfo
Returns:
the field type

getDeclaringClass

public ClassInfo getDeclaringClass()
Description copied from interface: MemberInfo
Get the declaring class

Specified by:
getDeclaringClass in interface MemberInfo
Returns:
the declaring class

getModifiers

public int getModifiers()
Description copied from interface: ModifierInfo
Get the modifiers

Specified by:
getModifiers in interface ModifierInfo
Returns:
the modifiers

isStatic

public boolean isStatic()
Description copied from interface: ModifierInfo
Whether it is static

Specified by:
isStatic in interface ModifierInfo
Returns:
true when static

isPublic

public boolean isPublic()
Specified by:
isPublic in interface ModifierInfo

isVolatile

public boolean isVolatile()
Description copied from interface: ModifierInfo
Whether it is volatile

Specified by:
isVolatile in interface ModifierInfo
Returns:
true if volatile

get

public Object get(Object target)
           throws Throwable
Description copied from interface: FieldInfo
Get the value of the field

Specified by:
get in interface FieldInfo
Parameters:
target - the target
Returns:
the field value
Throws:
Throwable - for any error

set

public Object set(Object target,
                  Object value)
           throws Throwable
Description copied from interface: FieldInfo
Set the value of the field

Specified by:
set in interface FieldInfo
Parameters:
target - the target
value - the value
Returns:
null
Throws:
Throwable - for any error

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class org.jboss.util.JBossObject

calculateHash

protected void calculateHash()
Calculate the hash code


JBoss Reflection 2.2.1.SP1

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.