Ontimize Web Services 1.003EN

com.ontimize.webservice.server
Class WSUtils

java.lang.Object
  extended by com.ontimize.webservice.server.WSUtils

public class WSUtils
extends java.lang.Object

This class contains several utils to convert data from Ontimize format to specific web services format for that application, and viceversa. Moreover, it contains other methods to convert strings (a single format to exchange data in web services) to whatever class depends on the indicated class name.


Constructor Summary
WSUtils()
           
 
Method Summary
static com.ontimize.webservice.server.OWSEntityResult entityResult2WSFormat(com.ontimize.db.EntityResult OntimizeFormatedQueryResult)
          Convert a Ontimize EntityResult to an object, which is defined in web services format.
static java.util.List<com.ontimize.webservice.server.OWSDoubleData> hashtable2WSFormat(java.util.Hashtable<java.lang.Object,java.lang.Object> h)
          Convert a java Hashtable to an object, which is defined in web services format.
protected static boolean isBoolean(java.lang.String value)
           
protected static boolean isByte(java.lang.String value)
           
protected static boolean isByteArray(java.lang.String value)
           
protected static boolean isCharacter(java.lang.String value)
           
protected static boolean isDate(java.lang.String value)
           
protected static boolean isDouble(java.lang.String value)
           
protected static boolean isFloat(java.lang.String value)
           
protected static boolean isInteger(java.lang.String value)
           
protected static boolean isLong(java.lang.String value)
           
protected static boolean isShort(java.lang.String value)
           
protected static boolean isString(java.lang.String value)
           
protected static boolean isTime(java.lang.String value)
           
protected static boolean isTimestamp(java.lang.String value)
           
protected static boolean isURL(java.lang.String value)
           
static java.util.Vector<java.lang.Object> listOWSComplexData2Hashtable(java.util.List<com.ontimize.webservice.server.OWSComplexData> av)
          Convert an Object codified in the web service format into a normal java Vector.
static java.util.Hashtable<java.lang.Object,java.lang.Object> listOWSDoubleData2Hashtable(java.util.List<com.ontimize.webservice.server.OWSDoubleData> hv)
          Convert an Object codified in the web service format into a normal java Hashtable.
static com.ontimize.db.EntityResult owsEntityResult2EntityResult(com.ontimize.webservice.server.OWSEntityResult owsEntityResult)
          Convert an Object codified in the web service format into a normal Ontimize EntityResult.
protected static void printErrorParsingInformation(java.lang.String type, java.lang.String value)
          Print always in the system error console the information related to the permitted data types for the Ontimize Web Services.
protected static java.lang.Boolean value2Boolean(java.lang.String value)
           
protected static java.lang.Byte value2Byte(java.lang.String value)
           
protected static byte[] value2ByteArray(java.lang.String value)
           
protected static java.lang.Character value2Character(java.lang.String value)
           
protected static java.sql.Date value2Date(java.lang.String value)
           
protected static java.lang.Double value2Double(java.lang.String value)
           
protected static java.lang.Float value2Float(java.lang.String value)
           
protected static java.lang.Integer value2Integer(java.lang.String value)
           
protected static java.lang.Long value2Long(java.lang.String value)
           
protected static java.lang.Object value2ObjectDependsOnType(java.lang.String type, java.lang.String value)
          Evaluates the class indicated by the string "type", and depending on it, generates a new Object to return of that class
protected static java.lang.Short value2Short(java.lang.String value)
           
protected static java.lang.String value2String(java.lang.String value)
           
protected static java.sql.Time value2Time(java.lang.String value)
           
protected static java.sql.Timestamp value2Timestamp(java.lang.String value)
           
protected static java.net.URL value2URL(java.lang.String value)
           
static java.lang.Class[] values2Class(java.util.Vector<java.lang.Object> values)
          Converts a vector in an Class Array.
static java.lang.Object[] vector2ObjectArray(java.util.Vector<java.lang.Object> values)
          Convert a vector into an Object Array.
static java.util.List<com.ontimize.webservice.server.OWSComplexData> vector2WSFormat(java.util.Vector<java.lang.Object> v)
          Convert a java Vector to an object, which is defined in web services format.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WSUtils

public WSUtils()
Method Detail

vector2WSFormat

public static java.util.List<com.ontimize.webservice.server.OWSComplexData> vector2WSFormat(java.util.Vector<java.lang.Object> v)
Convert a java Vector to an object, which is defined in web services format. In this case, the web services format to codified a vector is a List

Parameters:
v - the vector to convert
Returns:

hashtable2WSFormat

public static java.util.List<com.ontimize.webservice.server.OWSDoubleData> hashtable2WSFormat(java.util.Hashtable<java.lang.Object,java.lang.Object> h)
Convert a java Hashtable to an object, which is defined in web services format. In this case, the web services format to codified a Hashtable is a List.

Parameters:
h - Hashtable
Returns:

entityResult2WSFormat

public static com.ontimize.webservice.server.OWSEntityResult entityResult2WSFormat(com.ontimize.db.EntityResult OntimizeFormatedQueryResult)
Convert a Ontimize EntityResult to an object, which is defined in web services format. In this case, the web services format to codified a EntityResult is a OWSEntityResult.

Parameters:
OntimizeFormatedQueryResult - the EntityResult to convert
Returns:

listOWSComplexData2Hashtable

public static java.util.Vector<java.lang.Object> listOWSComplexData2Hashtable(java.util.List<com.ontimize.webservice.server.OWSComplexData> av)
Convert an Object codified in the web service format into a normal java Vector. In this case, the web services format to convert is a List

Parameters:
av - the element to convert
Returns:

listOWSDoubleData2Hashtable

public static java.util.Hashtable<java.lang.Object,java.lang.Object> listOWSDoubleData2Hashtable(java.util.List<com.ontimize.webservice.server.OWSDoubleData> hv)
Convert an Object codified in the web service format into a normal java Hashtable. In this case, the web services format to convert is a List.

Parameters:
hv - the element to convert
Returns:

owsEntityResult2EntityResult

public static com.ontimize.db.EntityResult owsEntityResult2EntityResult(com.ontimize.webservice.server.OWSEntityResult owsEntityResult)
Convert an Object codified in the web service format into a normal Ontimize EntityResult. In this case, the web services format to convert is a OWSEntityResult.

Parameters:
owsEntityResult - the element to convert
Returns:

value2ObjectDependsOnType

protected static java.lang.Object value2ObjectDependsOnType(java.lang.String type,
                                                            java.lang.String value)
Evaluates the class indicated by the string "type", and depending on it, generates a new Object to return of that class

Parameters:
type - parameters which indicates the name of the class of the value parameter.
value - the value codificated as an string
Returns:

isString

protected static boolean isString(java.lang.String value)

isInteger

protected static boolean isInteger(java.lang.String value)

isDouble

protected static boolean isDouble(java.lang.String value)

isFloat

protected static boolean isFloat(java.lang.String value)

isShort

protected static boolean isShort(java.lang.String value)

isLong

protected static boolean isLong(java.lang.String value)

isCharacter

protected static boolean isCharacter(java.lang.String value)

isByte

protected static boolean isByte(java.lang.String value)

isBoolean

protected static boolean isBoolean(java.lang.String value)

isByteArray

protected static boolean isByteArray(java.lang.String value)

isDate

protected static boolean isDate(java.lang.String value)

isTime

protected static boolean isTime(java.lang.String value)

isTimestamp

protected static boolean isTimestamp(java.lang.String value)

isURL

protected static boolean isURL(java.lang.String value)

value2String

protected static java.lang.String value2String(java.lang.String value)

value2Integer

protected static java.lang.Integer value2Integer(java.lang.String value)

value2Double

protected static java.lang.Double value2Double(java.lang.String value)

value2Float

protected static java.lang.Float value2Float(java.lang.String value)

value2Short

protected static java.lang.Short value2Short(java.lang.String value)

value2Long

protected static java.lang.Long value2Long(java.lang.String value)

value2Character

protected static java.lang.Character value2Character(java.lang.String value)

value2Byte

protected static java.lang.Byte value2Byte(java.lang.String value)

value2Boolean

protected static java.lang.Boolean value2Boolean(java.lang.String value)

value2ByteArray

protected static byte[] value2ByteArray(java.lang.String value)

value2Date

protected static java.sql.Date value2Date(java.lang.String value)

value2Time

protected static java.sql.Time value2Time(java.lang.String value)

value2Timestamp

protected static java.sql.Timestamp value2Timestamp(java.lang.String value)

value2URL

protected static java.net.URL value2URL(java.lang.String value)

printErrorParsingInformation

protected static void printErrorParsingInformation(java.lang.String type,
                                                   java.lang.String value)
Print always in the system error console the information related to the permitted data types for the Ontimize Web Services. This information is also shown by the default out console when the OntimizeWebServiceImpl.DEBUG variable is enable.


values2Class

public static java.lang.Class[] values2Class(java.util.Vector<java.lang.Object> values)
Converts a vector in an Class Array.

Parameters:
values - the vector to convert
Returns:

vector2ObjectArray

public static java.lang.Object[] vector2ObjectArray(java.util.Vector<java.lang.Object> values)
Convert a vector into an Object Array.

Parameters:
values - the vector to convert
Returns:

Ontimize Web Services