org.xwiki.model.reference
Class ClassPropertyReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
      extended by 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: fb52b3c4b66e3367beefb2b980e6d1232f6ad6c3 $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
 
Constructor Summary
  ClassPropertyReference(EntityReference reference)
          Constructor which would raise exceptions if the source entity reference does not have the appropriate type or parent, etc.
protected ClassPropertyReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
          Clone an ClassPropertyReference, but replace one of the parent in the chain by a new one.
  ClassPropertyReference(String propertyName, DocumentReference classReference)
          Builds a property reference for the passed property in the passed object.
  ClassPropertyReference(String wiki, String space, String page, String propertyName)
          Deprecated. 
 
Method Summary
 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, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, setName, setParameter, setParameters, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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 cloned
oldReference - the old parent that will be replaced
newReference - 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 for
classReference - the reference to the class whose property is

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 is
space - the space of the document where the parent class of this property is
page - the document where the parent class of this property is
propertyName - 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 class EntityReference
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 class EntityReference
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 class EntityReference
Parameters:
oldParent - the old parent that will be replaced
newParent - 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


Copyright © 2004–2014 XWiki. All rights reserved.