lumis.util.converter
Class ConverterDefaultParameterDecorator

Package class diagram package ConverterDefaultParameterDecorator
java.lang.Object
  extended by lumis.util.converter.ConverterDefaultParameterDecorator
All Implemented Interfaces:
IConverter

public class ConverterDefaultParameterDecorator
extends Object
implements IConverter

Decorates a IConverter allowing to define default parameters that are used when not specified.

Since:
4.0.4

Constructor Summary
ConverterDefaultParameterDecorator(IConverter converter, Locale defaultLocale, String defaultPattern)
          Creates a new decorator for the given converter that uses the default parameters given.
 
Method Summary
<T> T
convert(Class<T> type, Object value)
          Converts the specified input object into an output object of the specified type.
<T> T
convert(Class<T> type, Object value, Locale locale)
          Converts the specified input object into an output object of the specified type.
<T> T
convert(Class<T> type, Object value, Locale locale, String pattern)
          Converts the specified input object into an output object of the specified type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterDefaultParameterDecorator

public ConverterDefaultParameterDecorator(IConverter converter,
                                          Locale defaultLocale,
                                          String defaultPattern)
Creates a new decorator for the given converter that uses the default parameters given.

Parameters:
converter - the converter to be decorated.
defaultLocale - the default locale to use when the locale is not specified.
defaultPattern - the default pattern to use when the pattern is not specified.
Since:
4.0.4
Method Detail

convert

public <T> T convert(Class<T> type,
                     Object value,
                     Locale locale,
                     String pattern)
Description copied from interface: IConverter
Converts the specified input object into an output object of the specified type.

Specified by:
convert in interface IConverter
Type Parameters:
T - generics support for the data type specified.
Parameters:
type - data type to which the value should be converted.
value - the input value to be converted.
locale - locale to be used during conversion, if necessary.
pattern - converter specific conversion pattern, to be used during conversion, if necessary.

convert

public <T> T convert(Class<T> type,
                     Object value,
                     Locale locale)
Description copied from interface: IConverter
Converts the specified input object into an output object of the specified type.

Specified by:
convert in interface IConverter
Type Parameters:
T - generics support for the data type specified.
Parameters:
type - data type to which the value should be converted.
value - the input value to be converted.
locale - locale to be used during conversion

convert

public <T> T convert(Class<T> type,
                     Object value)
Description copied from interface: IConverter
Converts the specified input object into an output object of the specified type.

Specified by:
convert in interface IConverter
Type Parameters:
T - generics support for the data type specified.
Parameters:
type - data type to which the value should be converted.
value - the input value to be converted.


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.