public class PropertyPath extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
static PropertyPath |
create(RecordType recordType,
List<String> properties)
Creates a new property path instance.
|
static PropertyPath |
create(RecordType recordType,
String... properties)
Creates a new property path instance.
|
boolean |
equals(Object obj) |
List<String> |
getProperties()
Returns list of properties.
|
RecordProperty |
getRecordProperty(int index)
Returns the record property corresponding to the path segment at the given index.
|
RecordType |
getRecordType()
Returns the record type.
|
Type |
getType()
Returns the path type, i.e.
|
Object |
getValue(RecordHolder record)
Returns the value of the given property path of the given record object.
|
int |
hashCode() |
boolean |
isReadonly()
Returns
true if the property path is read-only,
i.e. |
void |
setValue(RecordHolder record,
Object value)
Sets the value of the given property path of the given record object.
|
int |
size()
Returns the size of the property path (the number of path segments).
|
String |
toString() |
public static PropertyPath create(RecordType recordType, List<String> properties)
If the size of properties list is 1, Property
instance is created,
if the size is greater than 1, PropertyPath
instance is created.
recordType
- properties
- public static PropertyPath create(RecordType recordType, String... properties)
If the size of properties list is 1, Property
instance is created,
if the size is greater than 1, PropertyPath
instance is created.
recordType
- properties
- IllegalArgumentException
- if the given path is not validpublic int size()
public RecordType getRecordType()
public List<String> getProperties()
public Type getType()
public boolean isReadonly()
true
if the property path is read-only,
i.e. if the last record property is read-only or its declaration
record is read-only.true
if the property path is read-onlypublic RecordProperty getRecordProperty(int index)
index
- public Object getValue(RecordHolder record) throws ErrorException
record
- ErrorException
- If the value cannot be obtained applying this property path to the given record.
The following error codes provides more detail about the problem:
Errors.INCOMPATIBLE_TYPE_ERROR
if the provided record type is incompatible
with this property path record type.Errors.NULL_PARAMETER_ERROR
if resolving the path encountered a null
member before reaching the end of the path.public void setValue(RecordHolder record, Object value) throws ErrorException
record
- value
- ErrorException
- If the value cannot be obtained applying this property path to the given record.
The following error codes provides more detail about the problem:
Errors.INCOMPATIBLE_TYPE_ERROR
if the provided record type is incompatible
with this property path record type.Errors.NULL_PARAMETER_ERROR
if resolving the path encountered a null
member before reaching the end of the path.Errors.READ_ONLY_ACCESS_ERROR
if the target of this property path is read onlyCopyright © 2007-2020 Whitestein Technologies. All Rights Reserved.