org.slim3.commons.beanutil
Class NumberConverter

java.lang.Object
  extended by org.slim3.commons.beanutil.NumberConverter
All Implemented Interfaces:
Converter

public class NumberConverter
extends Object
implements Converter

A converter for number.

Since:
3.0
Author:
higa

Field Summary
protected  String pattern
          The pattern for DecimalFormat.
 
Constructor Summary
NumberConverter(String pattern)
          Constructor.
 
Method Summary
 Object getAsObject(String value)
          Returns the value as object.
 String getAsString(Object value)
          Returns the value as string.
 boolean isTarget(Class<?> clazz)
          Determines if the class is target.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

protected String pattern
The pattern for DecimalFormat.

Constructor Detail

NumberConverter

public NumberConverter(String pattern)
                throws NullPointerException
Constructor.

Parameters:
pattern - the pattern for DecimalFormat
Throws:
NullPointerException - if the pattern parameter is null
Method Detail

getAsObject

public Object getAsObject(String value)
Description copied from interface: Converter
Returns the value as object.

Specified by:
getAsObject in interface Converter
Parameters:
value - the value
Returns:
the converted value

getAsString

public String getAsString(Object value)
Description copied from interface: Converter
Returns the value as string.

Specified by:
getAsString in interface Converter
Parameters:
value - the value
Returns:
the converted value

isTarget

public boolean isTarget(Class<?> clazz)
Description copied from interface: Converter
Determines if the class is target.

Specified by:
isTarget in interface Converter
Parameters:
clazz - the class
Returns:
whether the class is target


Copyright © 2008-2009 The Slim3 project. All Rights Reserved.