Field

public class Field extends AccessibleObject
implements Member

Stub implementation of Field. The actual implementation is in Field.h and Field.m, so the declared fields in this class should match the actual fields implemented in order to catch unsupported API references.

See Also

Inherited Constant Summary

Public Constructor Summary

Field()

Public Method Summary

Object
get(Object o)
<T extends Annotation> T
getAnnotation(Class<T> annotationClass)
Returns this element's annotation for the specified type if such an annotation is present, else null.
boolean
byte
char
Annotation[]
getDeclaredAnnotations()
Returns annotations that are directly present on this element.
Class<?>
getDeclaringClass()
Returns the Class object representing the class or interface that declares the member or constructor represented by this Member.
double
float
Type
int
long
int
getModifiers()
Returns the Java language modifiers for the member or constructor represented by this Member, as an integer.
String
getName()
Returns the simple name of the underlying member or constructor represented by this Member.
short
Class<?>
boolean
boolean
isSynthetic()
Returns true if this member was introduced by the compiler; returns false otherwise.
void
set(Object o, Object value)
void
setBoolean(Object o, boolean b)
void
setByte(Object o, byte b)
void
setChar(Object o, char c)
void
setDouble(Object o, double d)
void
setFloat(Object o, float f)
void
setInt(Object o, int i)
void
setLong(Object o, long l)
void
setShort(Object o, short s)
String

Inherited Method Summary

Public Constructors

public Field ()

Public Methods

public Object get (Object o)

public T getAnnotation (Class<T> annotationClass)

Returns this element's annotation for the specified type if such an annotation is present, else null.

Parameters
annotationClass the Class object corresponding to the annotation type
Returns
  • this element's annotation for the specified annotation type if present on this element, else null

public boolean getBoolean (Object o)

public byte getByte (Object o)

public char getChar (Object o)

public Annotation[] getDeclaredAnnotations ()

Returns annotations that are directly present on this element. This method ignores inherited annotations. If there are no annotations directly present on this element, the return value is an array of length 0. The caller of this method is free to modify the returned array; it will have no effect on the arrays returned to other callers.

Returns
  • annotations directly present on this element

public Class<?> getDeclaringClass ()

Returns the Class object representing the class or interface that declares the member or constructor represented by this Member.

Returns
  • an object representing the declaring class of the underlying member

public double getDouble (Object o)

public float getFloat (Object o)

public Type getGenericType ()

public int getInt (Object o)

public long getLong (Object o)

public int getModifiers ()

Returns the Java language modifiers for the member or constructor represented by this Member, as an integer. The Modifier class should be used to decode the modifiers in the integer.

Returns
  • the Java language modifiers for the underlying member

public String getName ()

Returns the simple name of the underlying member or constructor represented by this Member.

Returns
  • the simple name of the underlying member

public short getShort (Object o)

public Class<?> getType ()

public boolean isEnumConstant ()

public boolean isSynthetic ()

Returns true if this member was introduced by the compiler; returns false otherwise.

Returns
  • true if and only if this member was introduced by the compiler.

public void set (Object o, Object value)

public void setBoolean (Object o, boolean b)

public void setByte (Object o, byte b)

public void setChar (Object o, char c)

public void setDouble (Object o, double d)

public void setFloat (Object o, float f)

public void setInt (Object o, int i)

public void setLong (Object o, long l)

public void setShort (Object o, short s)

public String toGenericString ()