@Unstable public class PageReference extends AbstractLocalizedEntityReference
| Modifier and Type | Field and Description |
|---|---|
static Type |
TYPE_PROVIDER
The
Type for a Provider<PageReference>. |
LOCALETOSTRING_SERIALIZER| Modifier | Constructor and Description |
|---|---|
|
PageReference(EntityReference reference)
Special constructor that transforms a generic entity reference into a
PageReference. |
protected |
PageReference(EntityReference reference,
EntityReference oldReference,
EntityReference newReference)
Clone a page reference, but replace one of the parent in the chain by a new one.
|
|
PageReference(EntityReference reference,
Locale locale)
Clone an EntityReference and change/add the passed Locale.
|
|
PageReference(LocalPageReference localPageReference,
WikiReference wikiReference)
Create a new page reference from local page reference and wiki reference.
|
|
PageReference(String pageName,
EntityReference parent)
Create a page reference based on a page name and a parent entity reference.
|
|
PageReference(String pageName,
EntityReference parent,
Locale locale)
Create a page reference based on a page name and a parent entity reference.
|
|
PageReference(String wikiName,
List<String> pageNames)
Create a page reference based on a page name and a parent page reference.
|
|
PageReference(String wikiName,
List<String> pageNames,
Locale locale)
Create a page reference based on a page name and a parent page reference.
|
|
PageReference(String pageName,
PageReference parent)
Create a page reference based on a page name and a parent page reference.
|
|
PageReference(String wikiName,
String pageName,
String... pageNames)
Create a page reference based on a page name and a parent page reference.
|
|
PageReference(String pageName,
WikiReference parent)
Create a page reference based on a page name and a parent wiki reference.
|
| Modifier and Type | Method and Description |
|---|---|
WikiReference |
getWikiReference() |
PageReference |
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.
|
String |
toString() |
getLocale, setLocale, setParameterappendParent, compareTo, equals, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hashCode, hasParent, removeParent, setName, setParameters, sizepublic PageReference(EntityReference reference)
PageReference. 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 page referenceprotected PageReference(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 PageReference(String pageName, WikiReference parent)
pageName - the name of the pageparent - the wiki referencepublic PageReference(String pageName, PageReference parent)
pageName - the name of the pageparent - the page referencepublic PageReference(String pageName, EntityReference parent)
pageName - the name of the pageparent - the entity referencepublic PageReference(String pageName, EntityReference parent, Locale locale)
pageName - the name of the pageparent - the entity referencelocale - the Locale of the page.public PageReference(EntityReference reference, Locale locale)
reference - the reference to clonelocale - the Locale of the new referencepublic PageReference(String wikiName, List<String> pageNames)
wikiName - the name of the wikipageNames - the pages namespublic PageReference(String wikiName, List<String> pageNames, Locale locale)
wikiName - the name of the wikipageNames - the pages nameslocale - the Locale of the entity.public PageReference(String wikiName, String pageName, String... pageNames)
wikiName - the name of the wikipageName - the root page namepageNames - the children page namespublic PageReference(LocalPageReference localPageReference, WikiReference wikiReference)
localPageReference - the page reference without the wiki referencewikiReference - the wiki referenceprotected void setParent(EntityReference parent)
Overridden in order to verify the validity of the passed 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 page reference parent (ie either a page
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 EntityReferencetype - the type for this entityIllegalArgumentException - if the passed type is not a page typeEntityReference.setType(org.xwiki.model.EntityType)public PageReference 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 WikiReference getWikiReference()
public String toString()
toString in class EntityReferenceCopyright © 2004–2018 XWiki. All rights reserved.