APIdia Launch Partner
Top Description Fields Constructors Methods
com.badlogic.gdx.utils.reflect

public final Class Field

extends Object
Class Inheritance
Imports
java.lang.reflect.GenericArrayType, .Modifier, .ParameterizedType, .Type

Provides information about, and access to, a single field of a class or interface.
Author
nexsoftware

Field Summary

Modifier and TypeField and Description
private final Field

Constructor Summary

AccessConstructor and Description
pack-priv
Field(Field field)

Method Summary

Modifier and TypeMethod and Description
public Object
get(Object obj)

Returns the value of the field on the supplied object.

public Annotation
getDeclaredAnnotation(Class<? extends Annotation> annotationType)

Returns an Annotation object reflecting the annotation provided, or null of this field doesn't have such an annotation.

public Annotation[]
getDeclaredAnnotations()

Returns an array of Annotation objects reflecting all annotations declared by this field, or an empty array if there are none.

public Class<T>
getDeclaringClass()

Returns the Class object representing the class or interface that declares the field.

public Class<T>
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.

public String
getName()

Returns the name of the field.

public Class<T>
getType()

Returns a Class object that identifies the declared type for the field.

public boolean
public boolean
isAnnotationPresent(Class<? extends Annotation> annotationType)

Returns true if the field includes an annotation of the provided class type.

public boolean
isDefaultAccess()

Return true if the field does not include any of the private, protected, or public modifiers.

public boolean
isFinal()

Return true if the field includes the final modifier.

public boolean
isPrivate()

Return true if the field includes the private modifier.

public boolean
isProtected()

Return true if the field includes the protected modifier.

public boolean
isPublic()

Return true if the field includes the public modifier.

public boolean
isStatic()

Return true if the field includes the static modifier.

public boolean
isSynthetic()

Return true if the field is a synthetic field.

public boolean
isTransient()

Return true if the field includes the transient modifier.

public boolean
isVolatile()

Return true if the field includes the volatile modifier.

public void
set(Object obj, Object value)

Sets the value of the field on the supplied object.

public void
setAccessible(boolean accessible)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fieldback to summary
private final Field field

Constructor Detail

Fieldback to summary
pack-priv Field(Field field)

Method Detail

getback to summary
public Object get(Object obj) throws ReflectionException

Returns the value of the field on the supplied object.

getDeclaredAnnotationback to summary
public Annotation getDeclaredAnnotation(Class<? extends Annotation> annotationType)

Returns an Annotation object reflecting the annotation provided, or null of this field doesn't have such an annotation. This is a convenience function if the caller knows already which annotation type he's looking for.

getDeclaredAnnotationsback to summary
public Annotation[] getDeclaredAnnotations()

Returns an array of Annotation objects reflecting all annotations declared by this field, or an empty array if there are none. Does not include inherited annotations.

getDeclaringClassback to summary
public Class<T> getDeclaringClass()

Returns the Class object representing the class or interface that declares the field.

getElementTypeback to summary
public Class<T> 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.

getNameback to summary
public String getName()

Returns the name of the field.

getTypeback to summary
public Class<T> getType()

Returns a Class object that identifies the declared type for the field.

isAccessibleback to summary
public boolean isAccessible()
isAnnotationPresentback to summary
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)

Returns true if the field includes an annotation of the provided class type.

isDefaultAccessback to summary
public boolean isDefaultAccess()

Return true if the field does not include any of the private, protected, or public modifiers.

isFinalback to summary
public boolean isFinal()

Return true if the field includes the final modifier.

isPrivateback to summary
public boolean isPrivate()

Return true if the field includes the private modifier.

isProtectedback to summary
public boolean isProtected()

Return true if the field includes the protected modifier.

isPublicback to summary
public boolean isPublic()

Return true if the field includes the public modifier.

isStaticback to summary
public boolean isStatic()

Return true if the field includes the static modifier.

isSyntheticback to summary
public boolean isSynthetic()

Return true if the field is a synthetic field.

isTransientback to summary
public boolean isTransient()

Return true if the field includes the transient modifier.

isVolatileback to summary
public boolean isVolatile()

Return true if the field includes the volatile modifier.

setback to summary
public void set(Object obj, Object value) throws ReflectionException

Sets the value of the field on the supplied object.

setAccessibleback to summary
public void setAccessible(boolean accessible)