public class SpaceReference extends EntityReference
TOSTRING_SERIALIZER
Modifier | Constructor and Description |
---|---|
|
SpaceReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a
SpaceReference . |
protected |
SpaceReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone an SpaceReference, but replace one of the parent in the chain by a new one.
|
|
SpaceReference(String spaceName,
EntityReference parent)
Create a space reference based on a space name and a parent entity reference.
|
|
SpaceReference(String spaceName,
SpaceReference parent)
Create a space reference based on a space name and a parent space reference.
|
|
SpaceReference(String spaceName,
WikiReference parent)
Create a space reference based on a space name and a parent wiki reference.
|
Modifier and Type | Method and Description |
---|---|
SpaceReference |
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, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, setName, setParameter, setParameters, toString
public SpaceReference(EntityReference reference)
SpaceReference
. It checks the
validity of the passed reference (ie correct type).reference
- the entity reference to transformsIllegalArgumentException
- if the passed reference is not a valid space referenceprotected SpaceReference(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 SpaceReference(String spaceName, WikiReference parent)
spaceName
- the name of the spaceparent
- the wiki referencepublic SpaceReference(String spaceName, SpaceReference parent)
spaceName
- the name of the spaceparent
- the space referencepublic SpaceReference(String spaceName, EntityReference parent)
spaceName
- the name of the spaceparent
- the entity referenceprotected void setParent(EntityReference parent)
setParent
in class EntityReference
parent
- the parent for this entity, may be null for a root entity.IllegalArgumentException
- if the passed parent is not a valid space reference parent (ie either
a space reference or a wiki reference)EntityReference.setParent(EntityReference)
protected void setType(EntityType type)
setType
in class EntityReference
type
- the type for this entityIllegalArgumentException
- if the passed type is not a space typeEntityReference.setType(org.xwiki.model.EntityType)
public SpaceReference 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.Copyright © 2004–2015 XWiki. All rights reserved.