org.hippoecm.hst.content.beans.standard
Class HippoAvailableTranslations<K extends HippoBean>
java.lang.Object
org.hippoecm.hst.content.beans.standard.HippoItem
org.hippoecm.hst.content.beans.standard.HippoAvailableTranslations<K>
- All Implemented Interfaces:
- Comparable<HippoBean>, ObjectConverterAware, NodeAware, HippoAvailableTranslationsBean<K>, HippoBean
@Node(jcrType="hippotranslation:translations")
public class HippoAvailableTranslations<K extends HippoBean>
- extends HippoItem
- implements HippoAvailableTranslationsBean<K>
This is a useful bean for finding available translations of one and the same bean (folder or document). Because there is already also
nodetype hippo:translation used for translating a node name, see HippoTranslation
, we use for the current class a name
that might be unexpected wrt to its backing primary node type name, namely 'hippotranslation:translations'
Methods inherited from class org.hippoecm.hst.content.beans.standard.HippoItem |
attach, compareTo, detach, equalCompare, equals, getAvailableTranslationsBean, getBean, getBean, getCanonicalPath, getCanonicalUUID, getChildBeans, getChildBeans, getChildBeansByName, getChildBeansByName, getContextualBean, getContextualParentBean, getEqualComparator, getLinkedBean, getLinkedBeans, getLocalizedName, getName, getNode, getObjectConverter, getParentBean, getPath, getProperties, getProperty, getProperty, getProperty, getValueProvider, hashCode, isAncestor, isDescendant, isHippoDocumentBean, isHippoFolderBean, isLeaf, isSelf, setNode, setObjectConverter |
HippoAvailableTranslations
public HippoAvailableTranslations()
getAvailableLocales
public List<String> getAvailableLocales()
- Description copied from interface:
HippoAvailableTranslationsBean
- It returns the available translations.
- Specified by:
getAvailableLocales
in interface HippoAvailableTranslationsBean<K extends HippoBean>
- Returns:
- the
List
of available locale's and an empty List
is no locale's are present
getTranslation
public K getTranslation(String locale)
- Specified by:
getTranslation
in interface HippoAvailableTranslationsBean<K extends HippoBean>
- Parameters:
locale
- the locale for the translation
- Returns:
- returns the
T
for locale
and null
if not present
getTranslations
public List<K> getTranslations()
- Specified by:
getTranslations
in interface HippoAvailableTranslationsBean<K extends HippoBean>
- Returns:
- the List of all
T
's and an empty List
if no translations found
hasTranslation
public boolean hasTranslation(String locale)
- Specified by:
hasTranslation
in interface HippoAvailableTranslationsBean<K extends HippoBean>
- Returns:
true
when the translation for locale
is present
setBeanMappingClass
public void setBeanMappingClass(Class<K> beanMappingClass)
- Sets the
beanMappingClass
for this HippoAvailableTranslationsBean
. Only translations of type
beanMappingClass
will be returned
- Parameters:
beanMappingClass
-
Copyright © 2008-2012 Hippo. All Rights Reserved.