Package org.xwiki.model.reference
Class PageObjectPropertyReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.PageObjectPropertyReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
public class PageObjectPropertyReference extends EntityReference
References a property in an object in a document (the value of the property).- Since:
- 10.6RC1
- Version:
- $Id: 8de5ae728831a8cfa8879fd01fcc81650daa749d $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Modifier Constructor Description PageObjectPropertyReference(String propertyName, PageObjectReference objectReference)
Builds a property reference for the passed property in the passed object.PageObjectPropertyReference(EntityReference reference)
Constructor which would raise exceptions if the source entity reference does not have the appropriate type or parent, etc.PageObjectPropertyReference(EntityReference reference, EntityReference parent)
Clone an PageObjectPropertyReference, but use the specified parent for its new parent.protected
PageObjectPropertyReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an ObjectPropertyReference, but replace one of the parent in the chain by a new one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PageObjectPropertyReference
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.PageObjectPropertyReference
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.-
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameter, setParameters, size, toString
-
-
-
-
Constructor Detail
-
PageObjectPropertyReference
public PageObjectPropertyReference(EntityReference reference)
Constructor which would raise exceptions if the source entity reference does not have the appropriate type or parent, etc.- Parameters:
reference
- the raw reference to build this object reference from
-
PageObjectPropertyReference
protected PageObjectPropertyReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an ObjectPropertyReference, but replace one of the parent in the chain by a new one.- Parameters:
reference
- the reference that is clonedoldReference
- the old parent that will be replacednewReference
- the new parent that will replace oldReference in the chain
-
PageObjectPropertyReference
public PageObjectPropertyReference(String propertyName, PageObjectReference objectReference)
Builds a property reference for the passed property in the passed object.- Parameters:
propertyName
- the name of the property to create reference forobjectReference
- the reference to the object whose property is
-
PageObjectPropertyReference
public PageObjectPropertyReference(EntityReference reference, EntityReference parent)
Clone an PageObjectPropertyReference, but use the specified parent for its new parent.- Parameters:
reference
- the reference to cloneparent
- the new parent to use- Since:
- 10.8RC1
-
-
Method Detail
-
setType
protected void setType(EntityType type)
Entity reference are immutable since 3.3M2, so this method is now protected.Overridden to check the type to be a property type.
- Overrides:
setType
in classEntityReference
- Parameters:
type
- the type for this entity- See Also:
EntityReference.setType(org.xwiki.model.EntityType)
-
setParent
protected void setParent(EntityReference parent)
Entity reference are immutable since 3.3M2, so this method is now protected.Overridden to ensure that the parent of a property is always an object.
- Overrides:
setParent
in classEntityReference
- Parameters:
parent
- the parent for this entity, may be null for a root entity.- See Also:
EntityReference.setParent(org.xwiki.model.reference.EntityReference)
-
replaceParent
public PageObjectPropertyReference replaceParent(EntityReference oldParent, EntityReference newParent)
Description copied from class:EntityReference
Return a clone of this reference, but with one of its parent replaced by another one.- Overrides:
replaceParent
in classEntityReference
- Parameters:
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.- Returns:
- a new reference with a amended parent chain
-
replaceParent
public PageObjectPropertyReference replaceParent(EntityReference newParent)
Description copied from class:EntityReference
Return a clone of this reference, but with its parent replaced by the passed one.- Overrides:
replaceParent
in classEntityReference
- Parameters:
newParent
- the new parent that will replace the parent- Returns:
- a new reference with a amended parent chain
-
-