java.lang.Object
de.grogra.reflect.MemberBase
de.grogra.persistence.PersistenceField
- All Implemented Interfaces:
Field
,FieldChain
,Member
- Direct Known Subclasses:
IndirectField
,ManageableType.Field
A
PersistenceField
represents a field which can be handled
by classes of the persistence
package. It is
an abstract base class; its methods imply that a PersistenceField
is composed of a chain of fields of class
ManageableType.Field
. E.g., if an object
has a field location
of type javax.vecmath.Point3f
,
such a chain could be (location, x)
(then it denotes the
x
field of the location
field of the object).
A chain may involve array components. An array component is either
an array component in the sense of the Java programming language,
e.g., object.values[i]
, or an element of
java.util.List
or one of the primitive list classes in
de.grogra.util
, e.g., object.values.get (i)
.
When a PersistenceField
containing array components is
accessed by one of its methods, the indices
parameter has
to provide one index for every component. E.g., a field access
object.values[i].locations[j].x
is represented
by the chain (values, [], locations, [], x)
, where
[]
represents array components,
and indices = {i, j}
.- Author:
- Ole Kniemeyer
-
Field Summary
Fields inherited from class de.grogra.reflect.MemberBase
annots, declaringType, descriptor, modifiers, name
Fields inherited from interface de.grogra.reflect.Field
FIELD_0, INTERFACE_MODIFIERS, MODIFIERS
Fields inherited from interface de.grogra.reflect.Member
ABSTRACT, ACCESS_MODIFIERS, ARRAY, BRIDGE, CONSTANT, FINAL, INTERFACE, JAVA_MODIFIERS, LOCAL_CLASS, MIN_UNUSED_MODIFIER, NATIVE, PRIVATE, PROTECTED, PUBLIC, STATIC, STRICT, SYNCHRONIZED, SYNTHETIC, TRANSIENT, VARARGS, VOLATILE
-
Method Summary
Modifier and TypeMethodDescriptionstatic PersistenceField
final Object
abstract boolean
getBoolean
(Object o, int[] indices) Returns the value of a field.abstract byte
Returns the value of a field.abstract char
Returns the value of a field.abstract double
Returns the value of a field.final Field
getField
(int index) abstract float
Returns the value of a field.abstract int
Returns the value of a field.abstract ManageableType.Field
abstract long
Returns the value of a field.abstract Number
abstract Number
abstract Object
Returns the value of a field.abstract Quantity
abstract PersistenceField
getShallowSubchain
(int begin) abstract short
Returns the value of a field.abstract ManageableType.Field
getSubfield
(int index) abstract void
insertBoolean
(Object o, int[] indices, boolean value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertByte
(Object o, int[] indices, byte value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertChar
(Object o, int[] indices, char value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertDouble
(Object o, int[] indices, double value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertFloat
(Object o, int[] indices, float value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertInt
(Object o, int[] indices, int value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertLong
(Object o, int[] indices, long value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertObject
(Object o, int[] indices, Object value, Transaction t) Inserts the givenvalue
into an array.abstract void
insertShort
(Object o, int[] indices, short value, Transaction t) Inserts the givenvalue
into an array.boolean
isWritable
(Object object) abstract void
removeBoolean
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeByte
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeChar
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeDouble
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeFloat
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeInt
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeLong
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeObject
(Object o, int[] indices, Transaction t) Removes an element from an array.abstract void
removeShort
(Object o, int[] indices, Transaction t) Removes an element from an array.final void
set
(Object o, int[] indices, Object value, Transaction t) abstract void
setBoolean
(Object o, int[] indices, boolean value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setByte
(Object o, int[] indices, byte value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setChar
(Object o, int[] indices, char value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setDouble
(Object o, int[] indices, double value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setFloat
(Object o, int[] indices, float value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setInt
(Object o, int[] indices, int value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setLong
(Object o, int[] indices, long value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setObject
(Object o, int[] indices, Object value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.abstract void
setShort
(Object o, int[] indices, short value, Transaction t) Sets the value of this field on the instanceo
using the givenindices
andt
.Methods inherited from class de.grogra.reflect.MemberBase
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName, getSimpleName, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.grogra.reflect.Field
getBoolean, getByte, getChar, getDouble, getFloat, getInt, getLong, getObject, getShort, getType, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort
Methods inherited from interface de.grogra.reflect.FieldChain
length, overlaps
Methods inherited from interface de.grogra.reflect.Member
getDeclaredAnnotation, getDeclaredAnnotationCount, getDeclaringType, getDescriptor, getModifiers, getName, getSimpleName
-
Method Details
-
get
-
getField
- Specified by:
getField
in interfaceFieldChain
-
getSubfield
-
getLastField
-
getShallowSubchain
-
getQuantity
-
getMinValue
-
getMaxValue
-
isWritable
-
set
-
get
-
setBoolean
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertBoolean
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeBoolean
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getBoolean
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setByte
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertByte
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeByte
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getByte
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setShort
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertShort
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeShort
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getShort
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setChar
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertChar
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeChar
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getChar
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setInt
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertInt
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeInt
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getInt
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setLong
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertLong
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeLong
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getLong
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setFloat
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertFloat
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeFloat
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getFloat
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setDouble
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertDouble
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeDouble
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getDouble
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-
setObject
Sets the value of this field on the instanceo
using the givenindices
andt
.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the new valuet
- transaction context- See Also:
-
insertObject
Inserts the givenvalue
into an array. This field has to be an array component indexed byindices
. The newvalue
will be inserted at the place of the indexed component.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldsvalue
- the value to be insertedt
- transaction context- See Also:
-
removeObject
Removes an element from an array. This field has to be an array component indexed byindices
. The value at the indexed component will be removed.- Parameters:
o
- the instance for which the field is modifiedindices
- the indices for array fieldst
- transaction context- See Also:
-
getObject
Returns the value of a field.- Parameters:
o
- the instance for which the field value is returnedindices
- the indices for array fields- Returns:
- the field's value for the instance
pc
- See Also:
-