org.jostraca.util
Class TypeUtil

java.lang.Object
  extended byorg.jostraca.util.TypeUtil

public class TypeUtil
extends java.lang.Object

Mappings from a standard set of abstract type names to concrete Java language and other type names are provided. These mappings may not be one-to-one, so that in general reverse mappings are not available. They may also not be complete, so that certain standard types will not have appropriate mappings. In the case where the standard type name argument has no mapping, it is returned as the mapping value. This allows a certain amount of fault tolerance. Standard types are valid java variable names (but $ is not allowed) so that they can be used within code as identifier constituents. Subclasses for specialised mappings should extend this class. Arrays are not handled by this class, apart from the special case byte[]. Contracts: RejectNullArgs


Field Summary
static boolean DEFVAL_boolean
           
static byte DEFVAL_byte
           
static byte[] DEFVAL_bytes
           
static char DEFVAL_char
           
static double DEFVAL_double
           
static float DEFVAL_float
           
static int DEFVAL_int
           
static long DEFVAL_long
           
static java.lang.Object DEFVAL_Object
           
static short DEFVAL_short
           
static java.lang.String DEFVAL_String
           
protected static java.util.HashMap sDefaultMap
           
protected static java.util.HashMap sJavaMap
           
protected static java.util.HashMap sJavaResultSetMap
           
protected static java.util.HashMap sJavaWrapperMap
           
protected static java.util.HashMap sNonObjectJavaTypes
           
protected static java.util.HashMap sNumericJavaTypes
           
static java.lang.String TYPE_array
           
static java.lang.String TYPE_blob
           
static java.lang.String TYPE_boolean
           
static java.lang.String TYPE_byte
           
static java.lang.String TYPE_bytes
           
static java.lang.String TYPE_char
           
static java.lang.String TYPE_clob
           
static java.lang.String TYPE_datetime
           
static java.lang.String TYPE_decimal
           
static java.lang.String TYPE_double
           
static java.lang.String TYPE_float
           
static java.lang.String TYPE_int
           
static java.lang.String TYPE_long
           
static java.lang.String TYPE_object
           
static java.lang.String TYPE_short
           
static java.lang.String TYPE_string
           
static java.lang.String TYPE_time
           
static java.lang.String TYPE_timestamp
           
 
Constructor Summary
TypeUtil()
           
 
Method Summary
 java.lang.String convert_JavaWrapper_to_Java(java.lang.String pJavaWrapperObject, java.lang.String pStandardType)
           
 java.lang.String defaultValue(java.lang.String pStandardType)
           
 boolean isJavaNumeric(java.lang.String pStandardType)
           
 boolean isJavaObject(java.lang.String pStandardType)
           
 boolean isType(java.lang.String pStandardType)
           
 java.lang.String toJava(java.lang.String pStandardType)
           
 java.lang.String toJavaResultSet(java.lang.String pStandardType)
           
 java.lang.String toJavaWrapper(java.lang.String pStandardType)
           
protected  java.lang.String toType(java.lang.String pStandardType, java.util.HashMap pTypeTable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_object

public static final java.lang.String TYPE_object
See Also:
Constant Field Values

TYPE_string

public static final java.lang.String TYPE_string
See Also:
Constant Field Values

TYPE_char

public static final java.lang.String TYPE_char
See Also:
Constant Field Values

TYPE_short

public static final java.lang.String TYPE_short
See Also:
Constant Field Values

TYPE_int

public static final java.lang.String TYPE_int
See Also:
Constant Field Values

TYPE_long

public static final java.lang.String TYPE_long
See Also:
Constant Field Values

TYPE_float

public static final java.lang.String TYPE_float
See Also:
Constant Field Values

TYPE_double

public static final java.lang.String TYPE_double
See Also:
Constant Field Values

TYPE_byte

public static final java.lang.String TYPE_byte
See Also:
Constant Field Values

TYPE_bytes

public static final java.lang.String TYPE_bytes
See Also:
Constant Field Values

TYPE_boolean

public static final java.lang.String TYPE_boolean
See Also:
Constant Field Values

TYPE_time

public static final java.lang.String TYPE_time
See Also:
Constant Field Values

TYPE_timestamp

public static final java.lang.String TYPE_timestamp
See Also:
Constant Field Values

TYPE_datetime

public static final java.lang.String TYPE_datetime
See Also:
Constant Field Values

TYPE_decimal

public static final java.lang.String TYPE_decimal
See Also:
Constant Field Values

TYPE_clob

public static final java.lang.String TYPE_clob
See Also:
Constant Field Values

TYPE_blob

public static final java.lang.String TYPE_blob
See Also:
Constant Field Values

TYPE_array

public static final java.lang.String TYPE_array
See Also:
Constant Field Values

DEFVAL_Object

public static final java.lang.Object DEFVAL_Object

DEFVAL_String

public static final java.lang.String DEFVAL_String
See Also:
Constant Field Values

DEFVAL_char

public static final char DEFVAL_char
See Also:
Constant Field Values

DEFVAL_short

public static final short DEFVAL_short
See Also:
Constant Field Values

DEFVAL_int

public static final int DEFVAL_int
See Also:
Constant Field Values

DEFVAL_long

public static final long DEFVAL_long
See Also:
Constant Field Values

DEFVAL_float

public static final float DEFVAL_float
See Also:
Constant Field Values

DEFVAL_double

public static final double DEFVAL_double
See Also:
Constant Field Values

DEFVAL_byte

public static final byte DEFVAL_byte
See Also:
Constant Field Values

DEFVAL_bytes

public static final byte[] DEFVAL_bytes

DEFVAL_boolean

public static final boolean DEFVAL_boolean
See Also:
Constant Field Values

sJavaMap

protected static final java.util.HashMap sJavaMap

sJavaWrapperMap

protected static final java.util.HashMap sJavaWrapperMap

sJavaResultSetMap

protected static final java.util.HashMap sJavaResultSetMap

sNonObjectJavaTypes

protected static final java.util.HashMap sNonObjectJavaTypes

sNumericJavaTypes

protected static final java.util.HashMap sNumericJavaTypes

sDefaultMap

protected static final java.util.HashMap sDefaultMap
Constructor Detail

TypeUtil

public TypeUtil()
Method Detail

toJava

public java.lang.String toJava(java.lang.String pStandardType)

toJavaWrapper

public java.lang.String toJavaWrapper(java.lang.String pStandardType)

toJavaResultSet

public java.lang.String toJavaResultSet(java.lang.String pStandardType)

isType

public boolean isType(java.lang.String pStandardType)

isJavaObject

public boolean isJavaObject(java.lang.String pStandardType)

isJavaNumeric

public boolean isJavaNumeric(java.lang.String pStandardType)

defaultValue

public java.lang.String defaultValue(java.lang.String pStandardType)

convert_JavaWrapper_to_Java

public java.lang.String convert_JavaWrapper_to_Java(java.lang.String pJavaWrapperObject,
                                                    java.lang.String pStandardType)

toType

protected java.lang.String toType(java.lang.String pStandardType,
                                  java.util.HashMap pTypeTable)


Copyright © 2000-2002 Richard Rodger