Package org.ametys.odf.enumeration
Class MonthEnumerator
- java.lang.Object
 - 
- org.ametys.odf.enumeration.MonthEnumerator
 
 
- 
- All Implemented Interfaces:
 Enumerator<String>,Enumerator,Component,Serviceable
public class MonthEnumerator extends Object implements Enumerator<String>, Serviceable, Component, Enumerator
Month enumerator. 
- 
- 
Field Summary
Fields Modifier and Type Field Description private static String__CATALOGUEprivate static Map<String,I18nizableText>__MONTHSprotected I18nUtils_i18nUtilsi18n utilsstatic StringROLEAvalon Role 
- 
Constructor Summary
Constructors Constructor Description MonthEnumerator() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Object>getConfiguration()Get the configuration of this enumeratorMap<Object,I18nizableText>getEntries()Provides the enumerated values with their optional label.I18nizableTextgetEntry(String value)Retrieves a single label from a value.StringgetLabel(String code, String language)Get the translated label for the given codeMap<String,I18nizableText>getTypedEntries()Provides the enumerated values with their optional label.voidservice(ServiceManager manager) 
 - 
 
- 
- 
Field Detail
- 
__CATALOGUE
private static final String __CATALOGUE
- See Also:
 - Constant Field Values
 
 
- 
__MONTHS
private static final Map<String,I18nizableText> __MONTHS
 
- 
_i18nUtils
protected I18nUtils _i18nUtils
i18n utils 
 - 
 
- 
Constructor Detail
- 
MonthEnumerator
public MonthEnumerator()
 
 - 
 
- 
Method Detail
- 
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
 servicein interfaceServiceable- Throws:
 ServiceException
 
- 
getEntries
public Map<Object,I18nizableText> getEntries() throws Exception
Description copied from interface:EnumeratorProvides the enumerated values with their optional label.- Specified by:
 getEntriesin interfaceEnumerator- Returns:
 - the enumerated values and their label.
 - Throws:
 Exception- if an error occurs.
 
- 
getTypedEntries
public Map<String,I18nizableText> getTypedEntries() throws Exception
Description copied from interface:EnumeratorProvides the enumerated values with their optional label.- Specified by:
 getTypedEntriesin interfaceEnumerator<String>- Returns:
 - the enumerated values and their label.
 - Throws:
 Exception- if an error occurs. TODO NEWATTRIBUTEAPI: rename this method whenEnumeratorwill be removed
 
- 
getEntry
public I18nizableText getEntry(String value)
Description copied from interface:EnumeratorRetrieves a single label from a value.- Specified by:
 getEntryin interfaceEnumerator<String>- Specified by:
 getEntryin interfaceEnumerator- Parameters:
 value- the value.- Returns:
 - the label or 
nullif not found. 
 
- 
getLabel
public String getLabel(String code, String language)
Get the translated label for the given code- Parameters:
 code- The code to retrievelanguage- The language for the translation- Returns:
 - The translated label or an empty string
 
 
- 
getConfiguration
public Map<String,Object> getConfiguration()
Description copied from interface:EnumeratorGet the configuration of this enumerator- Specified by:
 getConfigurationin interfaceEnumerator<String>- Specified by:
 getConfigurationin interfaceEnumerator- Returns:
 - the configuration
 
 
 - 
 
 -