public class SpaceReference extends EntityReference
Modifier and Type | Field and Description |
---|---|
static Type |
TYPE_PROVIDER
The
Type for a Provider<SpaceReference> . |
TOSTRING_SERIALIZER
Modifier | Constructor and Description |
---|---|
|
SpaceReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a
SpaceReference . |
|
SpaceReference(EntityReference reference,
EntityReference parent)
Clone an SpaceReference, but use the specified parent for its new parent.
|
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 wikiName,
List<String> spaceNames)
Create a space reference based on a space name and a parent space reference.
|
|
SpaceReference(String spaceName,
SpaceReference parent)
Create a space reference based on a space name and a parent space reference.
|
|
SpaceReference(String wikiName,
String... spaceNames)
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 |
---|---|
WikiReference |
getWikiReference() |
SpaceReference |
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.
|
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, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameter, setParameters, size, 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 referencepublic SpaceReference(String wikiName, String... spaceNames)
wikiName
- the name of the wikispaceNames
- the spaces namespublic SpaceReference(String wikiName, List<String> spaceNames)
wikiName
- the name of the wikispaceNames
- the spaces namespublic SpaceReference(EntityReference reference, EntityReference parent)
reference
- the reference to cloneparent
- the new parent to useprotected void setParent(EntityReference parent)
Overridden in order to verify the validity of the passed 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)
Overridden in order to verify the validity of the passed 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.public SpaceReference replaceParent(EntityReference newParent)
EntityReference
replaceParent
in class EntityReference
newParent
- the new parent that will replace the parentpublic WikiReference getWikiReference()
Copyright © 2004–2021 XWiki. All rights reserved.