Package org.xwiki.model.reference
Class ClassPropertyReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.ClassPropertyReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
public class ClassPropertyReference extends EntityReference
References a property in a class in a document (the description of the property).- Since:
- 3.2M1
- Version:
- $Id: a23cb70c57f8780ad61d5de03d36f15f1fee2880 $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Modifier Constructor Description ClassPropertyReference(String wiki, String space, String page, String propertyName)
Deprecated.ClassPropertyReference(String propertyName, DocumentReference classReference)
Builds a property reference for the passed property in the passed object.ClassPropertyReference(EntityReference reference)
Constructor which would raise exceptions if the source entity reference does not have the appropriate type or parent, etc.ClassPropertyReference(EntityReference reference, EntityReference parent)
Clone an ClassPropertyReference, but use the specified parent for its new parent.protected
ClassPropertyReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an ClassPropertyReference, 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 ClassPropertyReference
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.ClassPropertyReference
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
-
ClassPropertyReference
public ClassPropertyReference(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
-
ClassPropertyReference
protected ClassPropertyReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an ClassPropertyReference, 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- Since:
- 3.3M2
-
ClassPropertyReference
public ClassPropertyReference(String propertyName, DocumentReference classReference)
Builds a property reference for the passed property in the passed object.- Parameters:
propertyName
- the name of the property to create reference forclassReference
- the reference to the class whose property is
-
ClassPropertyReference
public ClassPropertyReference(EntityReference reference, EntityReference parent)
Clone an ClassPropertyReference, but use the specified parent for its new parent.- Parameters:
reference
- the reference to cloneparent
- the new parent to use- Since:
- 10.8RC1
-
ClassPropertyReference
@Deprecated public ClassPropertyReference(String wiki, String space, String page, String propertyName)
Deprecated.Deprecated constructor.- Parameters:
wiki
- the wiki of the document where the parent class of this property isspace
- the space of the document where the parent class of this property ispage
- the document where the parent class of this property ispropertyName
- the name of the property to refer to
-
-
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 ClassPropertyReference 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 ClassPropertyReference 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
-
-