Package net.minidev.asm
Class Accessor
java.lang.Object
net.minidev.asm.Accessor
Contains all information needed to access a java field.
field, getter setter
this object is used internally by BeansAccess
- Author:
- Uriel Chemouni
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FieldField to accessprotected StringThe name of the field.protected TypeFiled Type using JDK 5+ generics if availableprotected Methodgetter Methods if availableprotected intFiled index in objectprotected MethodSetter Methods if availableprotected Class<?>Filed Class -
Constructor Summary
ConstructorsConstructorDescriptionAccessor(Class<?> c, Field field, FieldFilter filter) build accessor for a field -
Method Summary
Modifier and TypeMethodDescriptionreturn generics field Type.intgetIndex()getter for indexgetName()return the field nameClass<?>getType()return field ClassbooleanisEnum()is the field is an enum fieldbooleanisPublic()is the field access using Field access typebooleanChecks if the field is readable, either directly or through a getter method.booleanisUsable()Determines if the field is accessible for reading or writing operations.booleanDetermines if the field is writable, either directly or through a setter method.
-
Field Details
-
field
Field to access -
setter
Setter Methods if available -
getter
getter Methods if available -
index
protected int indexFiled index in object -
type
Filed Class -
genericType
Filed Type using JDK 5+ generics if available -
fieldName
The name of the field.
-
-
Constructor Details
-
Accessor
build accessor for a field- Parameters:
c- the handled classfield- the field to accessfilter- field filter
-
-
Method Details
-
getIndex
public int getIndex()getter for index- Returns:
- Index
-
isPublic
public boolean isPublic()is the field access using Field access type- Returns:
- if Accessor is public
-
isEnum
public boolean isEnum()is the field is an enum field- Returns:
- if Accessor return an Enum Class
-
getName
return the field name- Returns:
- the field name
-
getType
return field Class- Returns:
- field Class
-
getGenericType
return generics field Type.- Returns:
- generics field Type.
-
isUsable
public boolean isUsable()Determines if the field is accessible for reading or writing operations.- Returns:
- true if the field can be read or write
-
isReadable
public boolean isReadable()Checks if the field is readable, either directly or through a getter method.- Returns:
- true if the field can be read
-
isWritable
public boolean isWritable()Determines if the field is writable, either directly or through a setter method.- Returns:
- true if the field can be write
-