org.gxml.xs
Enum SmNativeType

java.lang.Object
  extended by java.lang.Enum<SmNativeType>
      extended by org.gxml.xs.SmNativeType
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SmNativeType>

public enum SmNativeType
extends java.lang.Enum<SmNativeType>

Symbolic constants representing the built-in types in XML Schema Part 2:Datatypes.
The enumeration captures both the XPath 2.0 and XQuery 1.0 Type Hierarchy as well as the special promotions that occur for XPath (xs:decimal -> xs:float, xs:float -> xs:double, xs:anyURI -> xs:string). This effectively results in two hierarchies.


Enum Constant Summary
ANY_ATOMIC_TYPE
          xs:anyAtomicType
ANY_SIMPLE_TYPE
          xs:anySimpleType
ANY_TYPE
          xs:anyType
ANY_URI
          xs:anyURI
BASE64_BINARY
          xs:base64Binary
BOOLEAN
          xs:boolean
BYTE
          xs:byte
DATE
          xs:date
DATETIME
          xs:dateTime
DECIMAL
          xs:decimal
DOUBLE
          xs:double
DURATION
          xs:duration
DURATION_DAYTIME
          xs:dayTimeDuration
DURATION_YEARMONTH
          xs:yearMonthDuration
ENTITIES
          xs:ENTITIES
ENTITY
          xs:ENTITY
FLOAT
          xs:float
GDAY
          xs:gDay
GMONTH
          xs:gMonth
GMONTHDAY
          xs:gMonthDay
GYEAR
          xs:gYear
GYEARMONTH
          xs:gYearMonth
HEX_BINARY
          xs:hexBinary
ID
          xs:ID
IDREF
          xs:IDREF
IDREFS
          xs:IDREFS
INT
          xs:int
INTEGER
          xs:integer
LANGUAGE
          xs:language
LONG
          xs:long
NAME
          xs:Name
NCNAME
          xs:NCName
NEGATIVE_INTEGER
          xs:negativeInteger
NMTOKEN
          xs:NMTOKEN
NMTOKENS
          xs:NMTOKENS
NON_NEGATIVE_INTEGER
          xs:nonNegativeInteger
NON_POSITIVE_INTEGER
          xs:nonPositiveInteger
NORMALIZED_STRING
          xs:normalizedString
NOTATION
          xs:NOTATION
POSITIVE_INTEGER
          xs:positiveInteger
QNAME
          xs:QName
SHORT
          xs:short
STRING
          xs:string
TIME
          xs:time
TOKEN
          xs:token
UNSIGNED_BYTE
          xs:unsignedByte
UNSIGNED_INT
          xs:unsignedInt
UNSIGNED_LONG
          xs:unsignedLong
UNSIGNED_SHORT
          xs:unsignedShort
UNTYPED
          xs:untyped
UNTYPED_ATOMIC
          xs:untypedAtomic
 
Method Summary
static SmNativeType computeCommonAncestorSelf(SmNativeType lhs, SmNativeType rhs, boolean promotions)
          Returns the common ancestor type of two types.
 java.lang.Iterable<SmNativeType> getAncestorOrSelf(boolean promotions)
          Returns an ordered collection of uber types, starting from the receiver uber type, and traversing up the hierarchy.
 java.lang.String getLocalName()
           
 javax.xml.namespace.QName getName()
          Returns the name of the type.
 SmNativeType getParent()
           
 SmNativeType getPromotion()
           
static SmNativeType getType(java.lang.String localName)
           
 boolean isA(SmNativeType other)
          Determines whether this type is equal to or derived from the specified type.
 boolean isGregorian()
          true if this type is ultimately derived from one of the Gregorian types, otherwise false.
 boolean isID()
          true if this type is ultimately derived from xs:ID, otherwise false.
 boolean isIDREF()
          true if this type is ultimately derived from xs:IDREF, otherwise false.
 boolean isNumeric()
          true if this type is ultimately derived from xs:double, xs:float or xs:decimal, otherwise false.
 boolean isUrType()
          Returs true if the type is one of xs:anyType, xs:anySimpleType or xs:anyAtomicType.
 boolean promotesTo(SmNativeType other)
          Determines whether this type is equal to or derived from the specified type when promotions are included.
static SmNativeType valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SmNativeType[] 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

ANY_TYPE

public static final SmNativeType ANY_TYPE
xs:anyType


ANY_SIMPLE_TYPE

public static final SmNativeType ANY_SIMPLE_TYPE
xs:anySimpleType


ANY_ATOMIC_TYPE

public static final SmNativeType ANY_ATOMIC_TYPE
xs:anyAtomicType


UNTYPED

public static final SmNativeType UNTYPED
xs:untyped


UNTYPED_ATOMIC

public static final SmNativeType UNTYPED_ATOMIC
xs:untypedAtomic


STRING

public static final SmNativeType STRING
xs:string


BOOLEAN

public static final SmNativeType BOOLEAN
xs:boolean


DATE

public static final SmNativeType DATE
xs:date


DATETIME

public static final SmNativeType DATETIME
xs:dateTime


TIME

public static final SmNativeType TIME
xs:time


GYEARMONTH

public static final SmNativeType GYEARMONTH
xs:gYearMonth


GYEAR

public static final SmNativeType GYEAR
xs:gYear


GMONTHDAY

public static final SmNativeType GMONTHDAY
xs:gMonthDay


GDAY

public static final SmNativeType GDAY
xs:gDay


GMONTH

public static final SmNativeType GMONTH
xs:gMonth


DURATION

public static final SmNativeType DURATION
xs:duration


BASE64_BINARY

public static final SmNativeType BASE64_BINARY
xs:base64Binary


HEX_BINARY

public static final SmNativeType HEX_BINARY
xs:hexBinary


ANY_URI

public static final SmNativeType ANY_URI
xs:anyURI


QNAME

public static final SmNativeType QNAME
xs:QName


NOTATION

public static final SmNativeType NOTATION
xs:NOTATION


DOUBLE

public static final SmNativeType DOUBLE
xs:double


FLOAT

public static final SmNativeType FLOAT
xs:float


DECIMAL

public static final SmNativeType DECIMAL
xs:decimal


INTEGER

public static final SmNativeType INTEGER
xs:integer


NON_POSITIVE_INTEGER

public static final SmNativeType NON_POSITIVE_INTEGER
xs:nonPositiveInteger


NEGATIVE_INTEGER

public static final SmNativeType NEGATIVE_INTEGER
xs:negativeInteger


LONG

public static final SmNativeType LONG
xs:long


INT

public static final SmNativeType INT
xs:int


SHORT

public static final SmNativeType SHORT
xs:short


BYTE

public static final SmNativeType BYTE
xs:byte


NON_NEGATIVE_INTEGER

public static final SmNativeType NON_NEGATIVE_INTEGER
xs:nonNegativeInteger


UNSIGNED_LONG

public static final SmNativeType UNSIGNED_LONG
xs:unsignedLong


UNSIGNED_INT

public static final SmNativeType UNSIGNED_INT
xs:unsignedInt


UNSIGNED_SHORT

public static final SmNativeType UNSIGNED_SHORT
xs:unsignedShort


UNSIGNED_BYTE

public static final SmNativeType UNSIGNED_BYTE
xs:unsignedByte


POSITIVE_INTEGER

public static final SmNativeType POSITIVE_INTEGER
xs:positiveInteger


NORMALIZED_STRING

public static final SmNativeType NORMALIZED_STRING
xs:normalizedString


TOKEN

public static final SmNativeType TOKEN
xs:token


LANGUAGE

public static final SmNativeType LANGUAGE
xs:language


NMTOKEN

public static final SmNativeType NMTOKEN
xs:NMTOKEN


NAME

public static final SmNativeType NAME
xs:Name


NCNAME

public static final SmNativeType NCNAME
xs:NCName


ID

public static final SmNativeType ID
xs:ID


IDREF

public static final SmNativeType IDREF
xs:IDREF


ENTITY

public static final SmNativeType ENTITY
xs:ENTITY


DURATION_YEARMONTH

public static final SmNativeType DURATION_YEARMONTH
xs:yearMonthDuration


DURATION_DAYTIME

public static final SmNativeType DURATION_DAYTIME
xs:dayTimeDuration


IDREFS

public static final SmNativeType IDREFS
xs:IDREFS


NMTOKENS

public static final SmNativeType NMTOKENS
xs:NMTOKENS


ENTITIES

public static final SmNativeType ENTITIES
xs:ENTITIES

Method Detail

values

public static SmNativeType[] 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 (SmNativeType c : SmNativeType.values())
    System.out.println(c);

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

valueOf

public static SmNativeType valueOf(java.lang.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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

isA

public boolean isA(SmNativeType other)
Determines whether this type is equal to or derived from the specified type.

Parameters:
other - The specified type.

promotesTo

public boolean promotesTo(SmNativeType other)
Determines whether this type is equal to or derived from the specified type when promotions are included.

Parameters:
other - The specified type.

isID

public boolean isID()
true if this type is ultimately derived from xs:ID, otherwise false.


isIDREF

public boolean isIDREF()
true if this type is ultimately derived from xs:IDREF, otherwise false.


isNumeric

public boolean isNumeric()
true if this type is ultimately derived from xs:double, xs:float or xs:decimal, otherwise false.


isGregorian

public boolean isGregorian()
true if this type is ultimately derived from one of the Gregorian types, otherwise false.


getName

public javax.xml.namespace.QName getName()
Returns the name of the type.

Returns:
The name of the type or null for user-defined types.

getLocalName

public java.lang.String getLocalName()

isUrType

public boolean isUrType()
Returs true if the type is one of xs:anyType, xs:anySimpleType or xs:anyAtomicType.


getParent

public SmNativeType getParent()

getPromotion

public SmNativeType getPromotion()

getAncestorOrSelf

public java.lang.Iterable<SmNativeType> getAncestorOrSelf(boolean promotions)
Returns an ordered collection of uber types, starting from the receiver uber type, and traversing up the hierarchy. The collection may be extended to include the promotions that occur in XPath: xs:decimal -> xs:float, xs:float -> xs:double, and xs:anyURI -> xs:string

Parameters:
promotions - Determines whether promotions are included in the returned collection.

computeCommonAncestorSelf

public static SmNativeType computeCommonAncestorSelf(SmNativeType lhs,
                                                     SmNativeType rhs,
                                                     boolean promotions)
Returns the common ancestor type of two types. The computation may be conditioned to include the promotions that occur in XPath.

Parameters:
lhs - The LHS type.
rhs - The RHS type.
promotions - Determines whether promotions are included in computation.
Returns:
The common ancestor type or null if one does not exist.

getType

public static SmNativeType getType(java.lang.String localName)


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.