public class DocumentReference extends AbstractLocalizedEntityReference
Modifier and Type | Field and Description |
---|---|
static Type |
TYPE_PROVIDER
The
Type for a Provider<DocumentReference> . |
TOSTRING_SERIALIZER
Modifier | Constructor and Description |
---|---|
|
DocumentReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a
DocumentReference . |
|
DocumentReference(EntityReference reference,
EntityReference parent)
Clone an DocumentReference, but use the specified parent for its new parent.
|
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 pageName,
EntityReference parent,
Map<String,Serializable> parameters) |
|
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() |
LocalDocumentReference |
getLocalDocumentReference() |
LocalDocumentReference |
getLocaleDocumentReference()
Deprecated.
since 9.3RC1/8.4.5, use
getLocalDocumentReference() instead |
List<SpaceReference> |
getSpaceReferences() |
WikiReference |
getWikiReference() |
DocumentReference |
replaceParent(EntityReference newParent)
Return a clone of this reference, but with its parent replaced by the passed one.
|
DocumentReference |
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.
|
DocumentReference |
setWikiReference(WikiReference wikiReference)
Create a new DocumentReference with passed wiki reference.
|
String |
toString() |
DocumentReference |
withoutLocale() |
getLocale, setLocale, setParameter
appendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameters, size
public 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 nullpublic DocumentReference(String pageName, EntityReference parent, Map<String,Serializable> parameters)
pageName
- the name of the documentparent
- the parent space for the documentparameters
- parameters for this reference, may be nullpublic DocumentReference(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 document reference parent (ie a space
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 document typeEntityReference.setType(org.xwiki.model.EntityType)
public WikiReference getWikiReference()
public DocumentReference setWikiReference(WikiReference wikiReference)
wikiReference
- the wiki reference to usepublic SpaceReference getLastSpaceReference()
public List<SpaceReference> getSpaceReferences()
public DocumentReference 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 DocumentReference replaceParent(EntityReference newParent)
EntityReference
replaceParent
in class EntityReference
newParent
- the new parent that will replace the parent@Deprecated public LocalDocumentReference getLocaleDocumentReference()
getLocalDocumentReference()
insteadLocalDocumentReference
corresponding to this DocumentReference
public LocalDocumentReference getLocalDocumentReference()
LocalDocumentReference
corresponding to this DocumentReference
public DocumentReference withoutLocale()
public String toString()
toString
in class EntityReference
Copyright © 2004–2021 XWiki. All rights reserved.