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.
Accepted formats for the object name are:
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.
|
BaseObjectReference(EntityReference reference,
EntityReference parent)
Clone an BaseObjectReference, but use the specified parent for its new parent.
|
BaseObjectReference(EntityReference 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 . |
Modifier and Type | Method and Description |
---|---|
static RegexEntityReference |
any(String classReference) |
static RegexEntityReference |
any(String classReference,
EntityReference parent) |
static List<com.xpn.xwiki.internal.event.XObjectEvent> |
anyEvents(String classReference) |
Integer |
getObjectNumber() |
DocumentReference |
getXClassReference() |
BaseObjectReference |
replaceParent(EntityReference newParent) |
getDocumentReference, replaceParent, setParent, setType
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameter, setParameters, size, 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 BaseObjectReference(EntityReference 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 BaseObjectReference(EntityReference reference, EntityReference parent)
reference
- the reference to cloneparent
- the new parent to usepublic static RegexEntityReference any(String classReference)
classReference
- the local reference of the class (e.g. "XWiki.XWikiPreferences")public static RegexEntityReference any(String classReference, EntityReference parent)
classReference
- the local reference of the class (e.g. "XWiki.XWikiPreferences")parent
- the parent of the object referencepublic static List<com.xpn.xwiki.internal.event.XObjectEvent> anyEvents(String classReference)
classReference
- the local reference of the class (e.g. "XWiki.XWikiPreferences")XObjectEvent
to listen to be notified or any modification on a xobjectpublic DocumentReference getXClassReference()
public Integer getObjectNumber()
null
and object should be interpreted as the first object of this class in the document.public BaseObjectReference replaceParent(EntityReference newParent)
replaceParent
in class ObjectReference
Copyright © 2004–2022 XWiki. All rights reserved.