|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.model.reference.EntityReference
org.xwiki.model.reference.DocumentReference
public class DocumentReference
Represents a reference to a document (wiki, space and page names).
| Field Summary |
|---|
| Fields inherited from class org.xwiki.model.reference.EntityReference |
|---|
TOSTRING_SERIALIZER |
| Constructor Summary | |
|---|---|
|
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. |
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class org.xwiki.model.reference.EntityReference |
|---|
appendParent, compareTo, equals, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, hashCode, removeParent, setName, setParameter, setParameters |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DocumentReference(EntityReference reference)
DocumentReference. It checks the
validity of the passed reference (ie correct type and correct parent).
reference - the reference to convert
IllegalArgumentException - if the passed reference is not a valid document reference
protected 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 chain
public DocumentReference(EntityReference reference,
Locale locale)
reference - the reference to clonelocale - the new locale for this reference, if null, locale is removed
IllegalArgumentException - if the passed reference is not a valid document reference
public 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 document
public 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 null
public 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 null
public 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 document
public 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 null
public DocumentReference(String pageName,
SpaceReference parent)
pageName - the name of the documentparent - the parent space for the document
public DocumentReference(LocalDocumentReference localDocumentReference,
WikiReference wikiReference)
localDocumentReference - the document reference without the wiki referencewikiReference - the wiki reference
public 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 null| Method Detail |
|---|
protected 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 entity
IllegalArgumentException - 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)
EntityReference
replaceParent 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 EntityReference
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||