public interface Field
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
get(java.lang.Object instance)
Returns the current value of the field for a given instance
|
Annotation |
getDeclaredAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
Returns a annotation on this field
|
Annotation[] |
getDeclaredAnnotations()
Returns the declared annotations
|
java.lang.Class |
getElementType(int index)
Returns the class of the generic type parameter at the specific index
|
java.lang.String |
getName()
Returns the name of the field
|
java.lang.Class |
getType()
Returns the class type this field was declared as
|
boolean |
isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
Returns true if the field if annotated with the given annotation class
|
boolean |
isDefaultAccess()
Returns if the field is not public/private/protected
|
boolean |
isFinal()
Returns if the field is declared as final
|
boolean |
isPrivate()
Returns if the field is private
|
boolean |
isProtected()
Returns if the field is protected
|
boolean |
isPublic()
Returns if the field is public
|
boolean |
isStatic()
Returns if the field is static
|
boolean |
isSynthetic()
Returns if the field is synthetic (generated by compiler)
|
boolean |
isTransient()
Returns if the field is declared transient
|
boolean |
isVolatile()
Returns if the field is declared volatile
|
void |
set(java.lang.Object instance,
java.lang.Object value)
Sets the current value of the field for a given instance
|
java.lang.String getName()
java.lang.Object get(java.lang.Object instance) throws ReflectionException
instance
- The instance to get the field's value fromReflectionException
void set(java.lang.Object instance, java.lang.Object value) throws ReflectionException
instance
- The instance to set the field's value forvalue
- The new valueReflectionException
boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
annotation
- The annotation classAnnotation[] getDeclaredAnnotations()
Annotation getDeclaredAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
annotationType
- The annotation type to search forjava.lang.Class getType()
java.lang.Class getElementType(int index)
index
- The generic parameter indexboolean isDefaultAccess()
boolean isFinal()
boolean isPrivate()
boolean isProtected()
boolean isPublic()
boolean isStatic()
boolean isTransient()
boolean isVolatile()
boolean isSynthetic()