com.silverpeas.pdc.web
Class LocalizedPdcAxisValue

java.lang.Object
  extended by com.silverpeas.pdc.model.PdcAxisValue
      extended by com.silverpeas.pdc.web.LocalizedPdcAxisValue
All Implemented Interfaces:
LocalizedValue, Serializable, Cloneable

public class LocalizedPdcAxisValue
extends PdcAxisValue
implements LocalizedValue

A decorator of a Pdc axis value by adding to it additional methods required to compute information to render in a view. Theses information are localized according to the language passed in the constructor.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.silverpeas.pdc.web.LocalizedValue
MAX_NUMBER_OF_RENDERED_PATH_NODE, NUMBER_OF_RENDERED_PATH_NODE_IN_TRUNCATION, SEPARATOR_PATH, TRUNCATION_SEPARATOR
 
Method Summary
static LocalizedPdcAxisValue decorate(PdcAxisValue value, String forLanguage)
           
 String getAxisId()
          Gets the unique identifier of the axis to which this value belongs to.
 Set<PdcAxisValue> getChildValues()
          Gets all the values into which this one can be refined or specifying in a little more.
 String getId()
           
 String getLanguage()
          Gets the language in which the path of the value is localized.
 String getLocalizedPath()
          Gets the path of the value whose the terms are translated in a given language.
 String getMeaning()
          Gets the meaning carried by this value.
 String getMeaningTranslatedIn(String language)
          Gets the meaning carried by this value translated in the specified language.
 PdcAxisValue getParentValue()
          Gets the value this one refines or specifies a little more.
 String getTerm()
          Gets the term carried by this value.
 String getTermTranslatedIn(String language)
          Gets the term carried by this value and translated in the specified language.
 String getValuePath()
          Gets the path of this value from the root value (that is a base value of the axis).
 boolean isBaseValue()
          Is this value is a base one?
 ClassifyValue toClassifyValue()
          Converts this PdC axis value to a ClassifyValue instance.
 String toString()
           
 
Methods inherited from class com.silverpeas.pdc.model.PdcAxisValue
aPdcAxisValue, aPdcAxisValueFromTreeNode, clone, equals, fromTreeNode, getTreeNode, getTreeNodeParents, getUsedAxis, hashCode, inAxisId, setId, withAsTreeNodeParents, withId
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

decorate

public static LocalizedPdcAxisValue decorate(PdcAxisValue value,
                                             String forLanguage)

getLocalizedPath

public String getLocalizedPath()
Description copied from interface: LocalizedValue
Gets the path of the value whose the terms are translated in a given language.

Specified by:
getLocalizedPath in interface LocalizedValue
Returns:
the translated path to render.

getLanguage

public String getLanguage()
Description copied from interface: LocalizedValue
Gets the language in which the path of the value is localized.

Specified by:
getLanguage in interface LocalizedValue
Returns:

toString

public String toString()
Overrides:
toString in class PdcAxisValue

toClassifyValue

public ClassifyValue toClassifyValue()
                              throws PdcException
Description copied from class: PdcAxisValue
Converts this PdC axis value to a ClassifyValue instance. This method is for compatibility with the old way to manage the classification.

Overrides:
toClassifyValue in class PdcAxisValue
Returns:
a ClassifyValue instance.
Throws:
PdcException - if an error occurs while transforming this value into a ClassifyValue instance.

isBaseValue

public boolean isBaseValue()
Description copied from class: PdcAxisValue
Is this value is a base one?

Overrides:
isBaseValue in class PdcAxisValue
Returns:
true if this value is an axis base value.

getValuePath

public String getValuePath()
Description copied from class: PdcAxisValue
Gets the path of this value from the root value (that is a base value of the axis). The path is made up of the identifiers of each parent value; for example : /0/2/3

Overrides:
getValuePath in class PdcAxisValue
Returns:
the path of its value.

getTermTranslatedIn

public String getTermTranslatedIn(String language)
Description copied from class: PdcAxisValue
Gets the term carried by this value and translated in the specified language.

Overrides:
getTermTranslatedIn in class PdcAxisValue
Parameters:
language - the language in which the term should be translated.
Returns:
the term translated in the specified language. If no such translation exists, then return the default term as get by calling getTerm() method.

getTerm

public String getTerm()
Description copied from class: PdcAxisValue
Gets the term carried by this value.

Overrides:
getTerm in class PdcAxisValue
Returns:
the term of the value.

getParentValue

public PdcAxisValue getParentValue()
Description copied from class: PdcAxisValue
Gets the value this one refines or specifies a little more. The returned value is the parent of this one in the semantic tree represented by the axis to which this value belongs.

Overrides:
getParentValue in class PdcAxisValue
Returns:
the axis value parent of this one or null if this value has no parent (in that case, this value is a base one).

getMeaningTranslatedIn

public String getMeaningTranslatedIn(String language)
Description copied from class: PdcAxisValue
Gets the meaning carried by this value translated in the specified language. The meaning is in fact the complete path of translated terms that made this value. For example, in an axis representing the geography, the meaning of the value "France / Rhônes-Alpes / Isère" is in french "Geographie / France / Rhônes-Alpes / Isère".

Overrides:
getMeaningTranslatedIn in class PdcAxisValue
Returns:
the meaning carried by this value, in other words the complete path of this value translated in the specified language. If no such translations exist, then the result is equivalent to the call of the getMeaning() method.

getMeaning

public String getMeaning()
Description copied from class: PdcAxisValue
Gets the meaning carried by this value. The meaning is in fact the complete path of terms that made this value. For example, in an axis representing the geography, the meaning of the value "France / Rhônes-Alpes / Isère" is "Geography / France / Rhônes-Alpes / Isère".

Overrides:
getMeaning in class PdcAxisValue
Returns:
the meaning carried by this value, in other words the complete path of this value.

getId

public String getId()
Overrides:
getId in class PdcAxisValue

getChildValues

public Set<PdcAxisValue> getChildValues()
Description copied from class: PdcAxisValue
Gets all the values into which this one can be refined or specifying in a little more. Theses values are the children of this one in the semantic tree represented by the axis to which this value belongs.

Overrides:
getChildValues in class PdcAxisValue
Returns:
an unmodifiable set of values that are children of this one. If this value is a leaf, then an empty set is returned.

getAxisId

public String getAxisId()
Description copied from class: PdcAxisValue
Gets the unique identifier of the axis to which this value belongs to.

Overrides:
getAxisId in class PdcAxisValue
Returns:
the unique identifier of the axis value.


Copyright © 2016 Silverpeas. All Rights Reserved.