nl.openedge.baritus.converters
Class FloatLocaleConverter

java.lang.Object
  extended bynl.openedge.baritus.converters.BaseLocaleConverter
      extended bynl.openedge.baritus.converters.DecimalLocaleConverter
          extended bynl.openedge.baritus.converters.FloatLocaleConverter
All Implemented Interfaces:
Converter, Formatter, LocaleConverter

public class FloatLocaleConverter
extends DecimalLocaleConverter

localized float converter

Author:
Eelco Hillenius

Field Summary
 
Fields inherited from class nl.openedge.baritus.converters.DecimalLocaleConverter
nonDigitPattern
 
Fields inherited from class nl.openedge.baritus.converters.BaseLocaleConverter
locale, locPattern, pattern
 
Constructor Summary
FloatLocaleConverter()
          Create a LocaleConverter that will throw a ConversionException if a conversion error occurs.
FloatLocaleConverter(java.util.Locale locale)
          Create a LocaleConverter that will throw a ConversionException if a conversion error occurs.
FloatLocaleConverter(java.util.Locale locale, java.lang.String pattern)
          Create a LocaleConverter that will throw a ConversionException if a conversion error occurs.
FloatLocaleConverter(java.util.Locale locale, java.lang.String pattern, boolean locPattern)
          Create a LocaleConverter that will throw a ConversionException if a conversion error occurs.
 
Method Summary
 java.lang.Object convert(java.lang.Class type, java.lang.Object value, java.lang.String pattern)
          Convert the specified locale-sensitive input object into an output object of the specified type.
protected  java.lang.Object parse(java.lang.Object value, java.lang.String pattern)
          Convert the specified locale-sensitive input object into an output object of the specified type.
 
Methods inherited from class nl.openedge.baritus.converters.DecimalLocaleConverter
format, getFormat, getNumber
 
Methods inherited from class nl.openedge.baritus.converters.BaseLocaleConverter
convert, convert, convert, getLocale, getPattern, setLocale, setPattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FloatLocaleConverter

public FloatLocaleConverter()
Create a LocaleConverter that will throw a ConversionException if a conversion error occurs. The locale is the default locale for this instance of the Java Virtual Machine and an unlocalized pattern is used for the convertion.


FloatLocaleConverter

public FloatLocaleConverter(java.util.Locale locale)
Create a LocaleConverter that will throw a ConversionException if a conversion error occurs. An unlocalized pattern is used for the convertion.

Parameters:
locale - The locale

FloatLocaleConverter

public FloatLocaleConverter(java.util.Locale locale,
                            java.lang.String pattern)
Create a LocaleConverter that will throw a ConversionException if a conversion error occurs. An unlocalized pattern is used for the convertion.

Parameters:
locale - The locale
pattern - The convertion pattern

FloatLocaleConverter

public FloatLocaleConverter(java.util.Locale locale,
                            java.lang.String pattern,
                            boolean locPattern)
Create a LocaleConverter that will throw a ConversionException if a conversion error occurs.

Parameters:
locale - The locale
pattern - The convertion pattern
locPattern - Indicate whether the pattern is localized or not
Method Detail

parse

protected java.lang.Object parse(java.lang.Object value,
                                 java.lang.String pattern)
                          throws java.text.ParseException
Convert the specified locale-sensitive input object into an output object of the specified type. This method will return Float value or throw exception if value can not be stored in the Float.

Overrides:
parse in class DecimalLocaleConverter
Parameters:
value - The input object to be converted
pattern - The pattern is used for the convertion
Throws:
ConversionException - if conversion cannot be performed successfully
java.text.ParseException

convert

public java.lang.Object convert(java.lang.Class type,
                                java.lang.Object value,
                                java.lang.String pattern)
Convert the specified locale-sensitive input object into an output object of the specified type.

Parameters:
type - Data type to which this value should be converted
value - The input object to be converted
pattern - The pattern is used for the convertion
Throws:
ConversionException - if conversion cannot be performed successfully


Copyright © 2003-2004 Open Edge. All Rights Reserved.