public class RefProperty extends Property
target Property. Created reference property acts as simple wrapper of target.
All methods call on reference will actually invoke methods on target. Reference and target property are of the same type - TypeDef.
What is also important, that reference property is equals to target property in the sense of equals and hashCode implementation.| Constructor and Description |
|---|
RefProperty(Property target)
Creates reference property, which points to
target Property. |
| Modifier and Type | Method and Description |
|---|---|
EntityProperty |
asEntity() |
Property |
deepcopy(boolean resetIds)
Creates new instance of
RefProperty with same target instance. |
boolean |
equals(Object o) |
Property |
find(long id)
Find child property in the target.
|
ElementType |
getElementType()
Gets associated element type, based on property implementation.
|
long |
getId() |
int |
getRefCount()
Number of nodes referencing target's property.
|
Property |
getRefTarget()
Gets property of reference's target.
|
boolean |
has(String path)
Checks if target property has element of given
path. |
int |
hashCode() |
boolean |
isRef()
Is property a reference type.
|
void |
print(StringBuilder sb,
int level,
String prefix,
String suffix)
Adds to
sb formatted String, specific for RefProperty, which looks like:
* [REF] cover1 (Cover#1003 @25658)
- [REF] cover2 (Cover#1004 @95658)
|
void |
set(Object value)
Sets new
value of this property. |
String |
toString()
Custom String format:
RefProperty[cart.policies, target=TypeCode#1234 @123456789]
|
add, add, asCollection, asRef, asValue, at, booleanValue, booleanValue, bundle, clear, create, deepcopy, get, getBoolean, getBoolean, getBundle, getCanonicalPath, getCollection, getContainer, getDate, getDate, getDatetime, getDatetime, getDecimal, getDecimal, getEntity, getHolder, getHolder, getInteger, getInteger, getLong, getLong, getName, getNumber, getNumber, getOwnerId, getOwnerPropertyName, getParent, getParentName, getPath, getState, getString, getString, getType, getTypeCode, intValue, intValue, isCollection, isEntity, isPersistent, isRoot, isTransient, isValue, iterator, print, remove, remove, resetIds, set, setContainer, setName, setOwnerId, setParent, setupOwnerId, size, traverse, traverseforEach, spliteratorpublic RefProperty(Property target)
target Property.
New created RefProperty will be of the same type, as passed target.target - property, to which created reference property pointspublic Property deepcopy(boolean resetIds)
RefProperty with same target instance.deepcopy in class PropertyresetIds - this flag doesn't apply hereProperty.deepcopy()public void print(StringBuilder sb, int level, String prefix, String suffix)
sb formatted String, specific for RefProperty, which looks like:
* [REF] cover1 (Cover#1003 @25658)
- [REF] cover2 (Cover#1004 @95658)
print in class Propertysb - StringBuilder containing data to printlevel - level used to indentationprefix - value to used as prefixsuffix - value to used as suffixtoString()public void set(Object value)
value of this property.
this reference will be removed from property tree, and new value will be used instead.public boolean isRef()
truepublic Property getRefTarget()
getRefTarget in interface HandlegetRefTarget in class Propertypublic int getRefCount()
getRefCount in interface HandlegetRefCount in class Propertypublic Property find(long id)
id - child idpublic boolean has(String path)
path.path - of element to be checkedtrue if target has element, or false otherwisepublic EntityProperty asEntity()
PropertyasEntity in interface HandleasEntity in class PropertyEntityPropertypublic ElementType getElementType()
HandleElementType.REF element typeHandle.get(String)Copyright © 2021. All rights reserved.