@AlfrescoPublicApi public class ChildAssociationRef extends Object implements EntityRef, Comparable<ChildAssociationRef>, Serializable
So it requires the parent node ref, the child node ref and the name of the child within the particular parent.
This combination is not a unique identifier for the relationship with regard to structure. In use this does not matter as we have no concept of order, particularly in the index.
Constructor and Description |
---|
ChildAssociationRef(QName assocTypeQName,
NodeRef parentRef,
QName childQName,
NodeRef childRef)
Constructs a non-primary, -1th sibling parent-child association
reference.
|
ChildAssociationRef(QName assocTypeQName,
NodeRef parentRef,
QName childQName,
NodeRef childRef,
boolean isPrimary,
int nthSibling)
Construct a representation of a parent --- name ----> child relationship.
|
ChildAssociationRef(String childAssocRefStr) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ChildAssociationRef another) |
boolean |
equals(Object o)
|
NodeRef |
getChildRef() |
int |
getNthSibling() |
NodeRef |
getParentRef() |
QName |
getQName()
Get the qualified name of the parent-child association
|
QName |
getTypeQName()
Get the qualified name of the association type
|
int |
hashCode() |
boolean |
isPrimary() |
void |
setNthSibling(int nthSibling)
Allows post-creation setting of the ordering index.
|
String |
toString() |
public ChildAssociationRef(QName assocTypeQName, NodeRef parentRef, QName childQName, NodeRef childRef, boolean isPrimary, int nthSibling)
assocTypeQName
- the type of the associationparentRef
- the parent reference - may be nullchildQName
- the qualified name of the association - may be nullchildRef
- the child node reference. This must not be null.isPrimary
- true if this represents the primary parent-child relationshipnthSibling
- the nth association with the same properties. Usually -1 to be
ignored.public ChildAssociationRef(QName assocTypeQName, NodeRef parentRef, QName childQName, NodeRef childRef)
public ChildAssociationRef(String childAssocRefStr)
childAssocRefStr
- a string of the form parentNodeRef|childNodeRef|assocTypeQName|assocQName|isPrimary|nthSiblingpublic String toString()
public boolean equals(Object o)
public int compareTo(ChildAssociationRef another)
compareTo
in interface Comparable<ChildAssociationRef>
setNthSibling(int)
public QName getTypeQName()
public QName getQName()
public NodeRef getChildRef()
public NodeRef getParentRef()
public boolean isPrimary()
public int getNthSibling()
public void setNthSibling(int nthSibling)
This index is in no way absolute and should change depending on the results that appear around this instance. Therefore, the sibling number cannot be used to construct, say, sibling number 5. Sibling number 5 will exist only in results where there are siblings 1 - 4.
nthSibling
- the sibling indexCopyright © 2005–2018 Alfresco Software. All rights reserved.