com.bowstreet.webapp
Class DataConverter

java.lang.Object
  extended by com.bowstreet.webapp.DataConverter

public class DataConverter
extends java.lang.Object

Class with static methods for converting between well-known object types (String, Double, Float, Integer, Long, Boolean, and IXml).


Constructor Summary
DataConverter()
           
 
Method Summary
static java.lang.Object append(java.lang.Object baseValue, java.lang.Object appendValue)
           
static boolean toboolean(java.lang.Object value)
          Leverages toBoolean to convert value to boolean.
static java.lang.Boolean toBoolean(java.lang.Object value)
          Converts Object to Boolean.
static byte tobyte(java.lang.Object value)
          Leverages toByte to convert value to byte.
static java.lang.Byte toByte(java.lang.Object value)
          Converts Object to Byte.
static char tochar(java.lang.Object value)
          Leverages toCharacter to convert value to char.
static java.lang.Character toCharacter(java.lang.Object value)
          Converts the first character of Object to a Character.
static double todouble(java.lang.Object value)
          Leverages toDouble to convert value to double.
static java.lang.Double toDouble(java.lang.Object value)
          Converts Object to Double.
static float tofloat(java.lang.Object value)
          Leverages toFloat to convert value to float.
static java.lang.Float toFloat(java.lang.Object value)
          Converts Object to Float.
static int toint(java.lang.Object value)
          Leverages toInteger to convert value to int.
static java.lang.Integer toInteger(java.lang.Object value)
          Converts Object to Integer.
static IXml toIXml(java.lang.Object value)
          Converts Object to IXml.
static long tolong(java.lang.Object value)
          Leverages toLong to convert value to long.
static java.lang.Long toLong(java.lang.Object value)
          Converts Object to Long.
static int toshort(java.lang.Object value)
          Leverages toInteger to convert value to int.
static java.lang.Short toShort(java.lang.Object value)
          Converts Object to Short.
static java.lang.String toString(boolean value)
          Converts boolean to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(char value)
          Converts char to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(double value)
          Converts double to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(float value)
          Converts float to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(int value)
          Converts int to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(long value)
          Converts long to String (returns the same value, but this method is used to support some code generation scenarios).
static java.lang.String toString(java.lang.Object value)
          Converts Object to String.
static java.lang.String toString(java.lang.String value)
          Converts String to String (returns the same value, but this method is used to support some code generation scenarios).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataConverter

public DataConverter()
Method Detail

append

public static java.lang.Object append(java.lang.Object baseValue,
                                      java.lang.Object appendValue)

toboolean

public static boolean toboolean(java.lang.Object value)
Leverages toBoolean to convert value to boolean.

Parameters:
value -
Returns:
The converted value

toBoolean

public static java.lang.Boolean toBoolean(java.lang.Object value)
Converts Object to Boolean. Object can be IXml (gets element text) or String (true or false).

Parameters:
value - The value to convert
Returns:
The converted value

tobyte

public static byte tobyte(java.lang.Object value)
Leverages toByte to convert value to byte.

Parameters:
value -
Returns:
The converted value

toByte

public static java.lang.Byte toByte(java.lang.Object value)
Converts Object to Byte. Object can be IXml (gets element text) or String (true or false).

Parameters:
value - The value to convert
Returns:
The converted value

tochar

public static char tochar(java.lang.Object value)
Leverages toCharacter to convert value to char.

Parameters:
value -
Returns:
The converted value

toCharacter

public static java.lang.Character toCharacter(java.lang.Object value)
Converts the first character of Object to a Character. Object can be IXml (gets element text) or String (true or false).

Parameters:
value - The value to convert
Returns:
The converted value

todouble

public static double todouble(java.lang.Object value)
Leverages toDouble to convert value to double.

Parameters:
value -
Returns:
The converted value

toDouble

public static java.lang.Double toDouble(java.lang.Object value)
Converts Object to Double. Object can be IXml (gets element text and parses), String (parses value), or any Number object.

Parameters:
value - The value to convert
Returns:
The converted value

tofloat

public static float tofloat(java.lang.Object value)
Leverages toFloat to convert value to float.

Parameters:
value -
Returns:
The converted value

toFloat

public static java.lang.Float toFloat(java.lang.Object value)
Converts Object to Float. Object can be IXml (gets element text and parses), String (parses value), or any Number object.

Parameters:
value - The value to convert
Returns:
The converted value

toint

public static int toint(java.lang.Object value)
Leverages toInteger to convert value to int.

Parameters:
value -
Returns:
The converted value

toInteger

public static java.lang.Integer toInteger(java.lang.Object value)
Converts Object to Integer. Object can be IXml (gets element text and parses), String (parses value), or any Number object.

Parameters:
value - The value to convert
Returns:
The converted value

toIXml

public static IXml toIXml(java.lang.Object value)
Converts Object to IXml. If value is String, attempts to parse as XML.

Parameters:
value - The value to convert
Returns:
The converted value

tolong

public static long tolong(java.lang.Object value)
Leverages toLong to convert value to long.

Parameters:
value -
Returns:
The converted value

toLong

public static java.lang.Long toLong(java.lang.Object value)
Converts Object to Long. Object can be IXml (gets element text and parses), String (parses value), or any Number object.

Parameters:
value - The value to convert
Returns:
The converted value

toshort

public static int toshort(java.lang.Object value)
Leverages toInteger to convert value to int.

Parameters:
value -
Returns:
The converted value

toShort

public static java.lang.Short toShort(java.lang.Object value)
Converts Object to Short. Object can be IXml (gets element text and parses), String (parses value), or any Number object.

Parameters:
value - The value to convert
Returns:
The converted value

toString

public static java.lang.String toString(boolean value)
Converts boolean to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(char value)
Converts char to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(double value)
Converts double to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(float value)
Converts float to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(int value)
Converts int to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(long value)
Converts long to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value

toString

public static java.lang.String toString(java.lang.Object value)
Converts Object to String. If object is IXml, gets the element text; otherwise calls toString.

Parameters:
value - The value to convert
Returns:
The converted value

toString

public static java.lang.String toString(java.lang.String value)
Converts String to String (returns the same value, but this method is used to support some code generation scenarios).

Parameters:
value - The value to convert
Returns:
The value


Copyright © 2009 IBM. All Rights Reserved.