org.deegree.commons.tom.primitive
Enum BaseType

java.lang.Object
  extended by java.lang.Enum<BaseType>
      extended by org.deegree.commons.tom.primitive.BaseType
All Implemented Interfaces:
Serializable, Comparable<BaseType>

public enum BaseType
extends Enum<BaseType>

Base primitive type system.

Based on XML schema types, but stripped down to leave out any distinctions that are not strictly necessary in the feature model.

Version:
$Revision: 31654 $, $Date: 2011-08-25 15:13:23 +0200 (Thu, 25 Aug 2011) $
Author:
Markus Schneider, last edited by: $Author: mschneider $

Enum Constant Summary
BOOLEAN
          Property value is of class Boolean.
DATE
          Property value is of class Date.
DATE_TIME
          Property value is of class DateTime.
DECIMAL
          Property value is of class BigDecimal.
DOUBLE
          Property value is of class Double (needed because BigDecimal cannot express "NaN", "-INF" and "INF"), which are required by xs:double / xs:float.
INTEGER
          Property value is of class BigInteger.
STRING
          Property value is of class String.
TIME
          Property value is of class Time.
 
Method Summary
 int getSQLType()
          Returns the
 Class<?> getValueClass()
          Returns the class that primitive values of this type must have.
 String getXSTypeName()
           
static BaseType valueOf(int sqlType)
          Returns the BaseType for the given SQL type (from Types).
static BaseType valueOf(Object value)
          Returns the BaseType for the given value.
static BaseType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static BaseType valueOf(org.apache.xerces.xs.XSSimpleTypeDefinition xsdTypeDef)
          Returns the BaseType for the given XSD simple type definition.
static BaseType[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STRING

public static final BaseType STRING
Property value is of class String.


BOOLEAN

public static final BaseType BOOLEAN
Property value is of class Boolean.


DECIMAL

public static final BaseType DECIMAL
Property value is of class BigDecimal.


DOUBLE

public static final BaseType DOUBLE
Property value is of class Double (needed because BigDecimal cannot express "NaN", "-INF" and "INF"), which are required by xs:double / xs:float.


INTEGER

public static final BaseType INTEGER
Property value is of class BigInteger.


DATE

public static final BaseType DATE
Property value is of class Date.


DATE_TIME

public static final BaseType DATE_TIME
Property value is of class DateTime.


TIME

public static final BaseType TIME
Property value is of class Time.

Method Detail

values

public static BaseType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (BaseType c : BaseType.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static BaseType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getValueClass

public Class<?> getValueClass()
Returns the class that primitive values of this type must have.

Returns:
the corresponding class for values

getXSTypeName

public String getXSTypeName()
Returns:

getSQLType

public int getSQLType()
Returns the

Returns:

valueOf

public static BaseType valueOf(Object value)
                        throws IllegalArgumentException
Returns the BaseType for the given value.

Parameters:
value -
Returns:
corresponding BaseType, never null
Throws:
IllegalArgumentException

valueOf

public static BaseType valueOf(int sqlType)
Returns the BaseType for the given SQL type (from Types).

Parameters:
sqlType -
Returns:
corresponding BaseType, never null
Throws:
IllegalArgumentException - if the SQL type can not be mapped to a BaseType
See Also:
Types

valueOf

public static BaseType valueOf(org.apache.xerces.xs.XSSimpleTypeDefinition xsdTypeDef)
Returns the BaseType for the given XSD simple type definition.

Parameters:
xsdTypeDef - XSD simple type definition, must not be null
Returns:
corresponding BaseType, never null


Copyright © 2011. All Rights Reserved.