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 protectedBeanTranslation()Constructs an empty translation.protectedBeanTranslation(String lang, String name, String description)protectedBeanTranslation(String id, String lang, String name, String description)protectedBeanTranslation(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.StringgetDescription()Gets the description about the resource in the underlying language.StringgetId()Gets the unique identifier of the object in Silverpeas.StringgetLanguage()Gets the language in which is this translation.StringgetName()Gets the name of the resource in the underlying language.StringgetObjectId()voidsetDescription(String description)voidsetId(String id)voidsetLanguage(String language)voidsetName(String name)voidsetObjectId(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:IdentifiableGets 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:
getIdin 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:TranslationGets the language in which is this translation.- Specified by:
getLanguagein 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:ResourceTranslationGets the name of the resource in the underlying language.- Specified by:
getNamein 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:ResourceTranslationGets the description about the resource in the underlying language.- Specified by:
getDescriptionin 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 theBeanTranslationclass having a public or a protected default constructor, otherwise aSilverpeasRuntimeExceptionexception is thrown. The difference between this copy method with the copy constructor is that it can be used against any child of theBeanTranslationclass without explicitly having a copy constructor or overriding this method.- Returns:
- a copy of this bean.
-
-