Class BeanProperty
- java.lang.Object
-
- jadex.commons.transformation.traverser.BeanProperty
-
public class BeanProperty extends java.lang.Object
This class is a struct for saving data about an inspected bean property.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.reflect.Field
field
The field.protected java.lang.reflect.Type
gentype
The generic type.protected java.lang.reflect.Method
getter
The getter.protected java.lang.invoke.MethodHandle
getterhandle
The getter handle access.protected java.lang.String
name
The name.protected boolean
readable
Readable flagprotected java.lang.reflect.Method
setter
The setter.protected java.lang.invoke.MethodHandle
setterhandle
The setter handle access.protected java.lang.Class<?>
settertype
The setter type.protected java.lang.invoke.MethodHandle
staticgetterhandle
The static getter handle access.protected java.lang.invoke.MethodHandle
staticsetterhandle
The static getter handle access.protected java.lang.Class<?>
type
The type.protected boolean
writable
Writable flag
-
Constructor Summary
Constructors Constructor Description BeanProperty()
Create a new bean property.BeanProperty(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Class<?> settertype, boolean readable, boolean writable, java.lang.reflect.Type gentype)
Create a new bean property.BeanProperty(java.lang.String name, java.lang.reflect.Field field)
Create a new bean property.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.reflect.Field
getField()
Get the field.java.lang.reflect.Type
getGenericType()
Get the gentype.java.lang.reflect.Method
getGetter()
Get the getter.java.lang.String
getName()
Get the name.java.lang.Object
getPropertyValue(java.lang.Object object)
Retrieves the bean property value for the given object.java.lang.reflect.Method
getSetter()
Get the setter.java.lang.Class<?>
getSetterType()
Get the setter_type.java.lang.Class<?>
getType()
Get the type.boolean
isReadable()
Tests if the property is readable.boolean
isWritable()
Tests if the property is writable.void
setField(java.lang.reflect.Field field)
Set the field.void
setGenericType(java.lang.reflect.Type gentype)
Set the gentype.void
setGetter(java.lang.reflect.Method getter)
Set the getter.void
setName(java.lang.String name)
Set the name.void
setPropertyValue(java.lang.Object object, java.lang.Object value)
Sets the bean property value for the given object.void
setSetter(java.lang.reflect.Method setter)
Set the setter.void
setSetterType(java.lang.Class<?> settertype)
Set the setter type.void
setType(java.lang.Class<?> type)
Set the type.
-
-
-
Field Detail
-
name
protected java.lang.String name
The name.
-
type
protected java.lang.Class<?> type
The type.
-
getter
protected java.lang.reflect.Method getter
The getter.
-
getterhandle
protected java.lang.invoke.MethodHandle getterhandle
The getter handle access.
-
staticgetterhandle
protected java.lang.invoke.MethodHandle staticgetterhandle
The static getter handle access.
-
setter
protected java.lang.reflect.Method setter
The setter.
-
setterhandle
protected java.lang.invoke.MethodHandle setterhandle
The setter handle access.
-
staticsetterhandle
protected java.lang.invoke.MethodHandle staticsetterhandle
The static getter handle access.
-
readable
protected boolean readable
Readable flag
-
writable
protected boolean writable
Writable flag
-
settertype
protected java.lang.Class<?> settertype
The setter type.
-
field
protected java.lang.reflect.Field field
The field.
-
gentype
protected java.lang.reflect.Type gentype
The generic type.
-
-
Constructor Detail
-
BeanProperty
public BeanProperty()
Create a new bean property.
-
BeanProperty
public BeanProperty(java.lang.String name, java.lang.Class<?> type, java.lang.reflect.Method getter, java.lang.reflect.Method setter, java.lang.Class<?> settertype, boolean readable, boolean writable, java.lang.reflect.Type gentype)
Create a new bean property.
-
BeanProperty
public BeanProperty(java.lang.String name, java.lang.reflect.Field field)
Create a new bean property.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the name.- Returns:
- The name.
-
setName
public void setName(java.lang.String name)
Set the name.- Parameters:
name
- The name to set.
-
getType
public java.lang.Class<?> getType()
Get the type.- Returns:
- The type.
-
setType
public void setType(java.lang.Class<?> type)
Set the type.- Parameters:
type
- The type to set.
-
getGetter
public java.lang.reflect.Method getGetter()
Get the getter.- Returns:
- The getter.
-
setGetter
public void setGetter(java.lang.reflect.Method getter)
Set the getter.- Parameters:
getter
- The getter to set.
-
getSetter
public java.lang.reflect.Method getSetter()
Get the setter.- Returns:
- The setter.
-
setSetter
public void setSetter(java.lang.reflect.Method setter)
Set the setter.- Parameters:
setter
- The setter to set.
-
isWritable
public boolean isWritable()
Tests if the property is writable.- Returns:
- True, if the property is writable.
-
isReadable
public boolean isReadable()
Tests if the property is readable.- Returns:
- True, if the property is readable.
-
getSetterType
public java.lang.Class<?> getSetterType()
Get the setter_type.- Returns:
- The setterttype.
-
setSetterType
public void setSetterType(java.lang.Class<?> settertype)
Set the setter type.- Parameters:
settertype
- The setter type to set.
-
getField
public java.lang.reflect.Field getField()
Get the field.- Returns:
- The field.
-
setField
public void setField(java.lang.reflect.Field field)
Set the field.- Parameters:
field
- The field to set.
-
getGenericType
public java.lang.reflect.Type getGenericType()
Get the gentype.- Returns:
- The gentype
-
setGenericType
public void setGenericType(java.lang.reflect.Type gentype)
Set the gentype.- Parameters:
gentype
- The gentype to set
-
getPropertyValue
public java.lang.Object getPropertyValue(java.lang.Object object)
Retrieves the bean property value for the given object.- Parameters:
object
- The object containing the bean property.property
- The name of the property.- Returns:
- The value of the bean property.
-
setPropertyValue
public void setPropertyValue(java.lang.Object object, java.lang.Object value)
Sets the bean property value for the given object.- Parameters:
object
- The object containing the bean property.property
- The name of the property.value
- The new value.
-
-