public class DocumentReference extends EntityReference
TOSTRING_SERIALIZER| Modifier | Constructor and Description |
|---|---|
|
DocumentReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a
DocumentReference. |
protected |
DocumentReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone an DocumentReference, but replace one of the parent in the chain by a new one.
|
|
DocumentReference(EntityReference reference,
Locale locale)
Clone the provided reference and change the Locale.
|
|
DocumentReference(LocalDocumentReference localDocumentReference,
WikiReference wikiReference)
Create a new Document reference from local document reference and wiki reference.
|
|
DocumentReference(String wikiName,
List<String> spaceNames,
String pageName)
Create a new Document reference from wiki name, spaces names and page name.
|
|
DocumentReference(String wikiName,
List<String> spaceNames,
String pageName,
Locale locale)
Create a new Document reference from wiki name, spaces names, page name and locale.
|
|
DocumentReference(String pageName,
SpaceReference parent)
Create a new Document reference from document name and parent space.
|
|
DocumentReference(String pageName,
SpaceReference parent,
Locale locale)
Create a new Document reference from document name, parent space and locale.
|
|
DocumentReference(String wikiName,
String spaceName,
String pageName)
Create a new Document reference from wiki, space and page name.
|
|
DocumentReference(String wikiName,
String spaceName,
String pageName,
Locale locale)
Create a new Document reference from wiki name, space name, page name and locale.
|
|
DocumentReference(String wikiName,
String spaceName,
String pageName,
String language)
Create a new Document reference from wiki name, space name, page name and language.
|
| Modifier and Type | Method and Description |
|---|---|
SpaceReference |
getLastSpaceReference() |
Locale |
getLocale() |
List<SpaceReference> |
getSpaceReferences() |
WikiReference |
getWikiReference() |
DocumentReference |
replaceParent(EntityReference oldParent,
EntityReference newParent)
Return a clone of this reference, but with one of its parent replaced by another one.
|
protected void |
setLocale(Locale locale)
Set the locale of this document reference.
|
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.
|
String |
toString() |
appendParent, compareTo, equals, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, setName, setParameter, setParameterspublic DocumentReference(EntityReference reference)
DocumentReference. It checks the
validity of the passed reference (ie correct type and correct parent).reference - the reference to convertIllegalArgumentException - if the passed reference is not a valid document referenceprotected DocumentReference(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 DocumentReference(EntityReference reference, Locale locale)
reference - the reference to clonelocale - the new locale for this reference, if null, locale is removedIllegalArgumentException - if the passed reference is not a valid document referencepublic DocumentReference(String wikiName, String spaceName, String pageName)
wikiName - the name of the wiki containing the document, must not be nullspaceName - the name of the space containing the document, must not be nullpageName - the name of the documentpublic DocumentReference(String wikiName, String spaceName, String pageName, Locale locale)
wikiName - the name of the wiki containing the document, must not be nullspaceName - the name of the space containing the document, must not be nullpageName - the name of the documentlocale - the locale of the document reference, may be nullpublic DocumentReference(String wikiName, String spaceName, String pageName, String language)
wikiName - the name of the wiki containing the document, must not be nullspaceName - the name of the space containing the document, must not be nullpageName - the name of the documentlanguage - the language of the document reference, may be nullpublic DocumentReference(String wikiName, List<String> spaceNames, String pageName)
wikiName - the name of the wiki containing the document, must not be nullspaceNames - 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 documentpublic DocumentReference(String wikiName, List<String> spaceNames, String pageName, Locale locale)
wikiName - the name of the wiki containing the document, must not be nullspaceNames - 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 referencelocale - the locale of the document reference, may be nullpublic DocumentReference(String pageName, SpaceReference parent)
pageName - the name of the documentparent - the parent space for the documentpublic DocumentReference(LocalDocumentReference localDocumentReference, WikiReference wikiReference)
localDocumentReference - the document reference without the wiki referencewikiReference - the wiki referencepublic DocumentReference(String pageName, SpaceReference parent, Locale locale)
pageName - the name of the documentparent - the parent space for the documentlocale - the locale of the document reference, may be nullprotected void setParent(EntityReference parent)
setParent in class EntityReferenceparent - the parent for this entity, may be null for a root entity.IllegalArgumentException - if the passed parent is not a valid document reference parent (ie a space
reference)EntityReference.setParent(EntityReference)protected void setType(EntityType type)
setType in class EntityReferencetype - the type for this entityIllegalArgumentException - if the passed type is not a document typeEntityReference.setType(org.xwiki.model.EntityType)protected void setLocale(Locale locale)
locale - the locale of this document referencepublic Locale getLocale()
public WikiReference getWikiReference()
public SpaceReference getLastSpaceReference()
public List<SpaceReference> getSpaceReferences()
public DocumentReference replaceParent(EntityReference oldParent, EntityReference newParent)
EntityReferencereplaceParent in class EntityReferenceoldParent - 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 String toString()
toString in class EntityReferenceCopyright © 2004–2015 XWiki. All rights reserved.