Package org.xwiki.model.reference
Class LocalDocumentReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.AbstractLocalizedEntityReference
-
- org.xwiki.model.reference.LocalDocumentReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
public class LocalDocumentReference extends AbstractLocalizedEntityReference
Represents a reference to a document in the current wiki.- Since:
- 5.0M1
- Version:
- $Id: 70096dd6c34a6718bf573d75ad5f7b40c37ba4ed $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.xwiki.model.reference.AbstractLocalizedEntityReference
LOCALE
-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Constructor Description LocalDocumentReference(Iterable<String> spaceNames, String pageName)
Create a new Document reference in the current wiki.LocalDocumentReference(String spaceName, String pageName)
Create a new Document reference in the current wiki.LocalDocumentReference(String spaceName, String pageName, Locale locale)
Create a new Document reference in the current wiki.LocalDocumentReference(String pageName, EntityReference spaceReference)
Create a new Document reference in the current wiki.LocalDocumentReference(DocumentReference documentReference)
LocalDocumentReference(EntityReference reference)
LocalDocumentReference(EntityReference entityReference, Locale locale)
LocalDocumentReference(EntityReference reference, EntityReference parent)
Clone an LocalDocumentReference, but use the specified parent for its new parent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LocalDocumentReference
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.String
toString()
-
Methods inherited from class org.xwiki.model.reference.AbstractLocalizedEntityReference
getLocale, setLocale, setParameter
-
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, replaceParent, setName, setParameters, setParent, setType, size
-
-
-
-
Constructor Detail
-
LocalDocumentReference
public LocalDocumentReference(String spaceName, String pageName)
Create a new Document reference in the current wiki.- Parameters:
spaceName
- the name of the space containing the document, must not be nullpageName
- the name of the document, must not be null
-
LocalDocumentReference
public LocalDocumentReference(Iterable<String> spaceNames, String pageName)
Create a new Document reference in the current wiki.- Parameters:
spaceNames
- an ordered list of the names of the spaces containing the document from root space to last one, must not be nullpageName
- the name of the document- Since:
- 7.3M1
-
LocalDocumentReference
public LocalDocumentReference(String spaceName, String pageName, Locale locale)
Create a new Document reference in the current wiki.- Parameters:
spaceName
- the name of the space containing the document, must not be nullpageName
- the name of the document, must not be nulllocale
- the new locale for this reference- Since:
- 5.3RC1
-
LocalDocumentReference
public LocalDocumentReference(DocumentReference documentReference)
- Parameters:
documentReference
- the full document reference- Since:
- 5.2M2
-
LocalDocumentReference
public LocalDocumentReference(EntityReference reference)
- Parameters:
reference
- the reference to clone- Since:
- 5.4RC1
-
LocalDocumentReference
public LocalDocumentReference(EntityReference entityReference, Locale locale)
- Parameters:
entityReference
- the referencelocale
- the new locale for this reference, if null, locale is removed- Since:
- 5.3RC1
-
LocalDocumentReference
public LocalDocumentReference(String pageName, EntityReference spaceReference)
Create a new Document reference in the current wiki.- Parameters:
pageName
- the name of the document, must not be nullspaceReference
- the reference of the space, must not be null- Since:
- 7.2M1
-
LocalDocumentReference
public LocalDocumentReference(EntityReference reference, EntityReference parent)
Clone an LocalDocumentReference, 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
-
replaceParent
public LocalDocumentReference 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
-
toString
public String toString()
- Overrides:
toString
in classEntityReference
-
-