Package org.silverpeas.core.i18n
Class BeanTranslation
- java.lang.Object
-
- org.silverpeas.core.i18n.BeanTranslation
-
- All Implemented Interfaces:
Serializable
,ResourceTranslation
,Translation
,Identifiable
- Direct Known Subclasses:
AxisHeaderI18N
,ComponentI18N
,NodeI18NDetail
,PublicationI18N
,SilverContentI18N
,SpaceI18N
,TreeNodeI18N
public class BeanTranslation extends Object implements ResourceTranslation, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BeanTranslation()
Constructs an empty translation.protected
BeanTranslation(String lang, String name, String description)
protected
BeanTranslation(String id, String lang, String name, String description)
protected
BeanTranslation(BeanTranslation translation)
Constructs a new translation of a bean by copying the specified one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends BeanTranslation>
Tcopy()
Copies this bean into another one.String
getDescription()
Gets the description about the resource in the underlying language.String
getId()
Gets the unique identifier of the object in Silverpeas.String
getLanguage()
Gets the language in which is this translation.String
getName()
Gets the name of the resource in the underlying language.String
getObjectId()
void
setDescription(String description)
void
setId(String id)
void
setLanguage(String language)
void
setName(String name)
void
setObjectId(String objectId)
-
-
-
Constructor Detail
-
BeanTranslation
protected BeanTranslation()
Constructs an empty translation.
-
BeanTranslation
protected BeanTranslation(BeanTranslation translation)
Constructs a new translation of a bean by copying the specified one. Only the identifier isn't copied as it should be unique.- Parameters:
translation
- the bean translation to copy.
-
-
Method Detail
-
getId
public final String getId()
Description copied from interface:Identifiable
Gets the unique identifier of the object in Silverpeas. If he's also identified by a local identifier, then this method should return the one global to Silverpeas.- Specified by:
getId
in interfaceIdentifiable
- Returns:
- the identifier encoded as a String. If the identifier is a complex one, that is made up of several identification parts, then the returned representation should take care of such a structure.
-
setId
public final void setId(String id)
-
getLanguage
public final String getLanguage()
Description copied from interface:Translation
Gets the language in which is this translation.- Specified by:
getLanguage
in interfaceTranslation
- Returns:
- the ISO 639-1 code of the language.
-
setLanguage
public final void setLanguage(String language)
-
getObjectId
public String getObjectId()
-
setObjectId
public void setObjectId(String objectId)
-
getName
public final String getName()
Description copied from interface:ResourceTranslation
Gets the name of the resource in the underlying language.- Specified by:
getName
in interfaceResourceTranslation
- Returns:
- the localized name or title of the resource.
-
setName
public final void setName(String name)
-
getDescription
public final String getDescription()
Description copied from interface:ResourceTranslation
Gets the description about the resource in the underlying language.- Specified by:
getDescription
in interfaceResourceTranslation
- Returns:
- a localized short description about the resource.
-
setDescription
public final void setDescription(String description)
-
copy
protected <T extends BeanTranslation> T copy()
Copies this bean into another one. This method expects the classes extending theBeanTranslation
class having a public or a protected default constructor, otherwise aSilverpeasRuntimeException
exception is thrown. The difference between this copy method with the copy constructor is that it can be used against any child of theBeanTranslation
class without explicitly having a copy constructor or overriding this method.- Returns:
- a copy of this bean.
-
-