se.lu.thep.waf.constraints
Class StringConverter

java.lang.Object
  extended by se.lu.thep.waf.constraints.StringConverter

public class StringConverter
extends java.lang.Object

Sole task is to convert a string into another type e.g. "10" -> Integer

Author:
gregory

Constructor Summary
StringConverter()
           
 
Method Summary
 java.lang.Boolean toBoolean(java.lang.String value)
           
 java.util.Date toDate(java.lang.String value, java.util.List<Format> formats)
           
 java.lang.Double toDouble(java.lang.String value)
           
 java.lang.Float toFloat(java.lang.String value)
           
 java.lang.Integer toInteger(java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringConverter

public StringConverter()
Method Detail

toInteger

public java.lang.Integer toInteger(java.lang.String value)
Parameters:
value -
Returns:
an Integer or null if value is null
Throws:
java.lang.NumberFormatException - if parsing of string failes

toFloat

public java.lang.Float toFloat(java.lang.String value)

toDouble

public java.lang.Double toDouble(java.lang.String value)

toBoolean

public java.lang.Boolean toBoolean(java.lang.String value)

toDate

public java.util.Date toDate(java.lang.String value,
                             java.util.List<Format> formats)
                      throws java.text.ParseException
Throws:
java.text.ParseException