public class ObjectReference extends EntityReference
TOSTRING_SERIALIZER
Modifier | Constructor and Description |
---|---|
|
ObjectReference(EntityReference reference)
Constructor which would raise exceptions if the source entity reference does not have the appropriate type or
parent, etc.
|
|
ObjectReference(EntityReference reference,
EntityReference parent)
Clone an ObjectReference, but use the specified parent for its new parent.
|
protected |
ObjectReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone an ObjectReference, but replace one of the parent in the chain by a new one.
|
|
ObjectReference(String objectName,
DocumentReference documentReference) |
|
ObjectReference(String wiki,
String space,
String document,
String objectName)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
DocumentReference |
getDocumentReference() |
ObjectReference |
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.
|
ObjectReference |
replaceParent(EntityReference oldParent,
EntityReference newParent)
Return a clone of this reference, but with one of its parent replaced by another one.
|
protected void |
setParent(EntityReference parent)
Entity reference are immutable since 3.3M2, so this method is now protected.
|
protected void |
setType(EntityType type)
Entity reference are immutable since 3.3M2, so this method is now protected.
|
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameter, setParameters, size, toString
public ObjectReference(EntityReference reference)
reference
- the raw reference to build this object reference fromprotected ObjectReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
reference
- the reference that is clonedoldReference
- the old parent that will be replacednewReference
- the new parent that will replace oldReference in the chainpublic ObjectReference(String objectName, DocumentReference documentReference)
objectName
- the name of the objectdocumentReference
- the reference of the parent document of the objectpublic ObjectReference(EntityReference reference, EntityReference parent)
reference
- the reference to cloneparent
- the new parent to use@Deprecated public ObjectReference(String wiki, String space, String document, String objectName)
wiki
- wiki where the parent document of the object isspace
- space where the parent document of the object isdocument
- parent document of the objectobjectName
- the name of the objectprotected void setType(EntityType type)
Overridden to check the type to be an object type.
setType
in class EntityReference
type
- the type for this entityEntityReference.setType(org.xwiki.model.EntityType)
protected void setParent(EntityReference parent)
Overridden to ensure that the parent of an object is always a document.
setParent
in class EntityReference
parent
- the parent for this entity, may be null for a root entity.EntityReference.setParent(org.xwiki.model.reference.EntityReference)
public ObjectReference replaceParent(EntityReference oldParent, EntityReference newParent)
EntityReference
replaceParent
in class EntityReference
oldParent
- the old parent that will be replacednewParent
- the new parent that will replace oldParent in the chain. If the same as oldParent, this is
returned.public ObjectReference replaceParent(EntityReference newParent)
EntityReference
replaceParent
in class EntityReference
newParent
- the new parent that will replace the parentpublic DocumentReference getDocumentReference()
Copyright © 2004–2021 XWiki. All rights reserved.