public class BaseObjectReference extends ObjectReference
className[objectNumber]
format. It provides
helper functions to extract the class name as specified by the caller, and object number. getXClassReference()
and object index by calling getObjectNumber()
.
getObjectNumber()
will return null
and className
is obtained by
calling getXClassReference()
.
Modifier and Type | Field and Description |
---|---|
protected Integer |
objectNumber
The number of this object.
|
protected DocumentReference |
xclassReference
The class reference of this object.
|
TOSTRING_SERIALIZER
Constructor and Description |
---|
BaseObjectReference(DocumentReference classReference,
Integer objectNumber,
DocumentReference parent)
Builds an indexed object reference for the object of class
className with index objectNumber in
the document referenced by parent . |
BaseObjectReference(EntityReference reference)
Constructor which would raise exceptions if the source entity reference does not have the appropriate type or
parent, etc.
|
Modifier and Type | Method and Description |
---|---|
Integer |
getObjectNumber() |
DocumentReference |
getXClassReference() |
protected void |
setName(String name)
Overridden to always compute the class name and the object number. |
replaceParent, setParent, setType
appendParent, compareTo, equals, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, setParameter, setParameters, toString
protected DocumentReference xclassReference
protected Integer objectNumber
public BaseObjectReference(EntityReference reference)
reference
- the raw reference to build this object reference frompublic BaseObjectReference(DocumentReference classReference, Integer objectNumber, DocumentReference parent)
className
with index objectNumber
in
the document referenced by parent
.classReference
- the name of the class of the objectobjectNumber
- the number of the object in the document, or null
if the default object should be
referencedparent
- reference to the parent document where the object ispublic DocumentReference getXClassReference()
public Integer getObjectNumber()
null
and object should be interpreted as the first object of this class in the document.protected void setName(String name)
setName
in class EntityReference
EntityReference.setName(java.lang.String)
Copyright © 2004–2014 XWiki. All rights reserved.