org.apache.cocoon.forms.datatype.convertor
Class EnumConvertor
java.lang.Object
org.apache.cocoon.forms.datatype.convertor.EnumConvertor
- All Implemented Interfaces:
- Convertor
public class EnumConvertor
- extends Object
- implements Convertor
A Convertor
implementation for types implementing Joshua Bloch's
typesafe enum pattern.
- Version:
- $Id: EnumConvertor.html 1304258 2012-03-23 10:09:27Z ilgrosso $
- See Also:
EnumType
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EnumConvertor
public EnumConvertor(String className)
- Construct a new EnumConvertor for a class
- Parameters:
className
- The package-qualified name of the class implementing
the typesafe enum pattern.
convertFromString
public ConversionResult convertFromString(String value,
Locale locale,
Convertor.FormatCache formatCache)
- Description copied from interface:
Convertor
- Converts string representation into the object of convertor's type.
- Specified by:
convertFromString
in interface Convertor
formatCache
- can be null if not needed
convertToString
public String convertToString(Object value,
Locale locale,
Convertor.FormatCache formatCache)
- Specified by:
convertToString
in interface Convertor
getTypeClass
public Class getTypeClass()
- Specified by:
getTypeClass
in interface Convertor
generateSaxFragment
public void generateSaxFragment(ContentHandler contentHandler,
Locale locale)
throws SAXException
- Description copied from interface:
Convertor
- Generates a bit of information about this convertor (optional).
- Specified by:
generateSaxFragment
in interface Convertor
- Throws:
SAXException
Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.