org.milyn.javabean.decoders
Class NumberDecoder

java.lang.Object
  extended by org.milyn.javabean.decoders.LocaleAwareDecoder
      extended by org.milyn.javabean.decoders.NumberDecoder
All Implemented Interfaces:
Serializable, Configurable, DataDecoder, DataEncoder
Direct Known Subclasses:
BigDecimalDecoder, BigIntegerDecoder, DoubleDecoder, FloatDecoder, IntegerDecoder, LongDecoder, ShortDecoder

public abstract class NumberDecoder
extends LocaleAwareDecoder
implements DataEncoder

Abstract Number based DataDecoder.

Author:
tom.fennelly@gmail.com
See Also:
Serialized Form

Nested Class Summary
static class NumberDecoder.NumberType
           
 
Nested classes/interfaces inherited from interface org.milyn.javabean.DataDecoder
DataDecoder.Factory
 
Field Summary
static String FORMAT
          Format.
static String TYPE
          Type.
 
Fields inherited from class org.milyn.javabean.decoders.LocaleAwareDecoder
LOCALE, LOCALE_COUNTRY_CODE, LOCALE_LANGUAGE_CODE, VERIFY_LOCALE
 
Constructor Summary
NumberDecoder()
           
 
Method Summary
 String encode(Object object)
          Encode an object to a string.
 NumberFormat getNumberFormat()
          Get the NumberFormat instance, if one exists.
 NumberDecoder.NumberType getType()
           
 boolean isPercentage()
           
 void setConfiguration(Properties config)
          Set the component configuration.
 
Methods inherited from class org.milyn.javabean.decoders.LocaleAwareDecoder
getConfiguration, getLocale, getLocale, isLocalInstalled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.milyn.javabean.DataDecoder
decode
 

Field Detail

FORMAT

public static final String FORMAT
Format.

See Also:
Constant Field Values

TYPE

public static final String TYPE
Type.

See Also:
Constant Field Values
Constructor Detail

NumberDecoder

public NumberDecoder()
Method Detail

setConfiguration

public void setConfiguration(Properties config)
                      throws SmooksConfigurationException
Description copied from interface: Configurable
Set the component configuration.

Specified by:
setConfiguration in interface Configurable
Overrides:
setConfiguration in class LocaleAwareDecoder
Parameters:
config - The component configuration properties.
Throws:
SmooksConfigurationException - Bad component configuration.

getNumberFormat

public NumberFormat getNumberFormat()
Get the NumberFormat instance, if one exists.

Returns:
A clone of the NumberFormat instance, otherwise null.

getType

public NumberDecoder.NumberType getType()

isPercentage

public boolean isPercentage()

encode

public String encode(Object object)
              throws DataDecodeException
Description copied from interface: DataEncoder
Encode an object to a string.

Specified by:
encode in interface DataEncoder
Parameters:
object - The object to be encoded.
Returns:
The encoded object.
Throws:
DataDecodeException - Error encoding object.


Copyright © 2018. All rights reserved.