org.hippoecm.hst.content.beans.standard
Class HippoAvailableTranslations<K extends HippoBean>

java.lang.Object
  extended by org.hippoecm.hst.content.beans.standard.HippoItem
      extended by 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'


Nested Class Summary
 
Nested classes/interfaces inherited from class org.hippoecm.hst.content.beans.standard.HippoItem
HippoItem.ComparatorMap
 
Nested classes/interfaces inherited from interface org.hippoecm.hst.content.beans.standard.HippoAvailableTranslationsBean
HippoAvailableTranslationsBean.NoopTranslationsBean<K extends HippoBean>
 
Field Summary
 
Fields inherited from class org.hippoecm.hst.content.beans.standard.HippoItem
comparePath, detached, node, objectConverter, valueProvider
 
Constructor Summary
HippoAvailableTranslations()
           
 
Method Summary
 List<String> getAvailableLocales()
          It returns the available translations.
 K getTranslation(String locale)
           
 List<K> getTranslations()
           
 boolean hasTranslation(String locale)
           
 void setBeanMappingClass(Class<K> beanMappingClass)
          Sets the beanMappingClass for this HippoAvailableTranslationsBean.
 
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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HippoAvailableTranslations

public HippoAvailableTranslations()
Method Detail

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.