public final class Field extends Object
Modifier and Type | Method and Description |
---|---|
Object |
get(Object obj)
Returns the value of the field on the supplied object.
|
Class |
getDeclaringClass()
Returns the Class object representing the class or interface that declares the field.
|
Class |
getElementType(int index)
If the type of the field is parameterized, returns the Class object representing the parameter type at the specified index,
null otherwise.
|
String |
getName()
Returns the name of the field.
|
Class |
getType()
Returns a Class object that identifies the declared type for the field.
|
boolean |
isAccessible() |
boolean |
isDefaultAccess()
Return true if the field does not include any of the
private , protected , or public modifiers. |
boolean |
isFinal()
Return true if the field includes the
final modifier. |
boolean |
isPrivate()
Return true if the field includes the
private modifier. |
boolean |
isProtected()
Return true if the field includes the
protected modifier. |
boolean |
isPublic()
Return true if the field includes the
public modifier. |
boolean |
isStatic()
Return true if the field includes the
static modifier. |
boolean |
isSynthetic()
Return true if the field is a synthetic field.
|
boolean |
isTransient()
Return true if the field includes the
transient modifier. |
boolean |
isVolatile()
Return true if the field includes the
volatile modifier. |
void |
set(Object obj,
Object value)
Sets the value of the field on the supplied object.
|
void |
setAccessible(boolean accessible) |
public String getName()
public Class getType()
public Class getDeclaringClass()
public boolean isAccessible()
public void setAccessible(boolean accessible)
public boolean isDefaultAccess()
private
, protected
, or public
modifiers.public boolean isFinal()
final
modifier.public boolean isPrivate()
private
modifier.public boolean isProtected()
protected
modifier.public boolean isPublic()
public
modifier.public boolean isStatic()
static
modifier.public boolean isTransient()
transient
modifier.public boolean isVolatile()
volatile
modifier.public boolean isSynthetic()
public Class getElementType(int index)
public Object get(Object obj) throws ReflectionException
ReflectionException
public void set(Object obj, Object value) throws ReflectionException
ReflectionException
Copyright © 2014. All Rights Reserved.