| Modifier and Type | Field and Description |
|---|---|
java.lang.reflect.Field |
field |
| Constructor and Description |
|---|
JvmField(java.lang.reflect.Field 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
|
public java.lang.String getName()
Fieldpublic java.lang.Object get(java.lang.Object instance)
throws ReflectionException
Fieldget in interface Fieldinstance - The instance to get the field's value fromReflectionExceptionpublic void set(java.lang.Object instance,
java.lang.Object value)
throws ReflectionException
Fieldset in interface Fieldinstance - The instance to set the field's value forvalue - The new valueReflectionExceptionpublic boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotation)
FieldisAnnotationPresent in interface Fieldannotation - The annotation classpublic Annotation[] getDeclaredAnnotations()
FieldgetDeclaredAnnotations in interface Fieldpublic Annotation getDeclaredAnnotation(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType)
FieldgetDeclaredAnnotation in interface FieldannotationType - The annotation type to search forpublic java.lang.Class getType()
Fieldpublic java.lang.Class getElementType(int index)
FieldgetElementType in interface Fieldindex - The generic parameter indexpublic boolean isDefaultAccess()
FieldisDefaultAccess in interface Fieldpublic boolean isFinal()
Fieldpublic boolean isPrivate()
Fieldpublic boolean isProtected()
FieldisProtected in interface Fieldpublic boolean isPublic()
Fieldpublic boolean isStatic()
Fieldpublic boolean isTransient()
FieldisTransient in interface Fieldpublic boolean isVolatile()
FieldisVolatile in interface Fieldpublic boolean isSynthetic()
FieldisSynthetic in interface Field