org.exolab.jms.tools.db
Class Type

java.lang.Object
  |
  +--org.exolab.jms.tools.db.Type

public class Type
extends java.lang.Object

This class is a helper class for converting from string values to their corresponding java.sql.Types

Version:
$Revision: 1.1 $ $Date: 2004/11/26 01:51:16 $
Author:
Tim Anderson

Constructor Summary
Type(int type, long precision, boolean parameters)
          Construct an instance, using the default name for the type
Type(int type, java.lang.String name, long precision, boolean parameters)
          Construct an instance specifying the database specific type name
 
Method Summary
 java.lang.String getName()
          Returns the name of the type
 boolean getParameters()
          Returns if the type takes parameters when created
 long getPrecision()
          Returns the precision of the type
 java.lang.String getSQL()
          Returns an SQL representation of the type
 java.lang.String getSymbolicType()
          Returns a symbolic representation of the type
 int getType()
          Returns the type identifier
static Type getType(java.lang.String type)
          Returns a new type corresponding to its string representation
 java.lang.String toString()
          Returns a string representation of the type, for debugging purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Type

public Type(int type,
            long precision,
            boolean parameters)
Construct an instance, using the default name for the type
Parameters:
type - a type corresponding to one in java.sql.Types
precision - the precision of the type. A precision <= 0 indicates that the type has no precision
parameters - if true, denotes that the type takes parameters
Throws:
java.lang.IllegalArgumentException - if type is invalid

Type

public Type(int type,
            java.lang.String name,
            long precision,
            boolean parameters)
Construct an instance specifying the database specific type name
Parameters:
type - a type corresponding to one in java.sql.Types
name - the RDBMS name of the type
precision - the precision of the type. A precision <= 0 indicates that the type has no precision
parameters - if true, denotes that the type takes parameters
Throws:
java.lang.IllegalArgumentException - if type is invalid
Method Detail

getType

public int getType()
Returns the type identifier
Returns:
the type identifier, corresponding to one in java.sql.Types

getName

public java.lang.String getName()
Returns the name of the type
Returns:
the type name

getPrecision

public long getPrecision()
Returns the precision of the type
Returns:
the type precision

getParameters

public boolean getParameters()
Returns if the type takes parameters when created
Returns:
true if the type takes parameters when created, false otherwise

getSymbolicType

public java.lang.String getSymbolicType()
Returns a symbolic representation of the type
Returns:
a symbolic representation of the type

getSQL

public java.lang.String getSQL()
Returns an SQL representation of the type
Returns:
an SQL string representation of the type

toString

public java.lang.String toString()
Returns a string representation of the type, for debugging purposes
Overrides:
toString in class java.lang.Object

getType

public static Type getType(java.lang.String type)
                    throws org.exolab.jms.persistence.PersistenceException
Returns a new type corresponding to its string representation
Parameters:
type - the string representation of the type
Returns:
the type corresponding to the string
Throws:
org.exolab.jms.persistence.PersistenceException - if the string is invalid


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.