Package org.xwiki.model.reference
Class AbstractLocalizedEntityReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.AbstractLocalizedEntityReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
- Direct Known Subclasses:
DocumentReference
,LocalDocumentReference
,LocalPageReference
,PageReference
public abstract class AbstractLocalizedEntityReference extends EntityReference
Represents an entity reference which contains a locale.- Since:
- 10.6RC1
- Version:
- $Id: 2a9ed11bf7734775eaded4e9fbfa4c537098d221 $
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
LOCALE
Parameter key for the locale.-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractLocalizedEntityReference(String name, EntityType type)
Create a new EntityReference.AbstractLocalizedEntityReference(String name, EntityType type, Locale locale)
Create a new EntityReference.AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent)
Create a new EntityReference.AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent, Locale locale)
AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent, Map<String,Serializable> parameters)
Create a new EntityReference.AbstractLocalizedEntityReference(EntityReference reference)
Clone an EntityReference.AbstractLocalizedEntityReference(EntityReference reference, Locale locale)
Clone an EntityReference and change/add the passed Locale.AbstractLocalizedEntityReference(EntityReference reference, EntityReference parent)
Clone an AbstractLocalizedEntityReference, but use the specified parent for its new parent.protected
AbstractLocalizedEntityReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an EntityReference, but replace one of the parent in the chain by an other one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Locale
getLocale()
protected void
setLocale(Locale locale)
Set the locale of this reference.protected void
setParameter(String name, Serializable value)
Add or set a parameter value.-
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, replaceParent, setName, setParameters, setParent, setType, size, toString
-
-
-
-
Field Detail
-
LOCALE
public static final String LOCALE
Parameter key for the locale.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(String name, EntityType type)
Create a new EntityReference.- Parameters:
name
- name for the newly created entity reference, could not be null.type
- type for the newly created entity reference, could not be null.
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(String name, EntityType type, Locale locale)
Create a new EntityReference.- Parameters:
name
- name for the newly created entity reference, could not be null.type
- type for the newly created entity reference, could not be null.locale
- theLocale
of the entity.
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent)
Create a new EntityReference.- Parameters:
name
- name for the newly created entity reference, could not be null.type
- type for the newly created entity reference, could not be null.parent
- parent reference for the newly created entity reference, may be null.
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent, Map<String,Serializable> parameters)
Create a new EntityReference.- Parameters:
name
- name for the newly created entity reference, could not be null.type
- type for the newly created entity reference, could not be null.parent
- parent reference for the newly created entity reference, may be null.parameters
- parameters for this reference, may be null
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(String name, EntityType type, EntityReference parent, Locale locale)
- Parameters:
name
- name for the newly created entity reference, could not be null.type
- type for the newly created entity reference, could not be null.parent
- parent reference for the newly created entity reference, may be null.locale
- theLocale
of the entity.
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(EntityReference reference)
Clone an EntityReference.- Parameters:
reference
- the reference to clone
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(EntityReference reference, Locale locale)
Clone an EntityReference and change/add the passed Locale.- Parameters:
reference
- the reference to clonelocale
- theLocale
of the new reference
-
AbstractLocalizedEntityReference
protected AbstractLocalizedEntityReference(EntityReference reference, EntityReference oldReference, EntityReference newReference)
Clone an EntityReference, but replace one of the parent in the chain by an other one.- Parameters:
reference
- the reference that is clonedoldReference
- the old parent that will be replacednewReference
- the new parent that will replace oldReference in the chain
-
AbstractLocalizedEntityReference
public AbstractLocalizedEntityReference(EntityReference reference, EntityReference parent)
Clone an AbstractLocalizedEntityReference, 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
-
setLocale
protected void setLocale(Locale locale)
Set the locale of this reference.- Parameters:
locale
- the locale of this document reference
-
getLocale
public Locale getLocale()
- Returns:
- the locale of this reference
-
setParameter
protected void setParameter(String name, Serializable value)
Add or set a parameter value. Parameters should be immutable objects to prevent any weird behavior.Make sure to store the locale as
Locale
.- Overrides:
setParameter
in classEntityReference
- Parameters:
name
- the name of the parametervalue
- the value of the parameter- See Also:
EntityReference.setParameter(java.lang.String, java.io.Serializable)
-
-