org.exolab.castor.xml.schema
Class Facet

java.lang.Object
  extended by org.exolab.castor.xml.schema.Structure
      extended by org.exolab.castor.xml.schema.Annotated
          extended by org.exolab.castor.xml.schema.Facet
All Implemented Interfaces:
java.io.Serializable

public class Facet
extends Annotated

Represents the base type for XML Schema Facets

Version:
$Revision: 1.1.1.1 $ $Date: 2003/03/03 07:09:31 $
Author:
Keith Visco
See Also:
Serialized Form

Field Summary
static java.lang.String ENUMERATION
           
static java.lang.String FRACTIONDIGITS
           
static java.lang.String LENGTH
           
static java.lang.String MAX_EXCLUSIVE
           
static java.lang.String MAX_INCLUSIVE
           
static java.lang.String MAX_LENGTH
           
static java.lang.String MIN_EXCLUSIVE
           
static java.lang.String MIN_INCLUSIVE
           
static java.lang.String MIN_LENGTH
           
static java.lang.String PATTERN
           
static java.lang.String PRECISION
           
static java.lang.String TOTALDIGITS
           
static java.lang.String WHITESPACE
           
 
Fields inherited from class org.exolab.castor.xml.schema.Structure
ANNOTATION, ANYTYPE, APPINFO, ATTRIBUTE, ATTRIBUTE_GROUP, COMPLEX_CONTENT, COMPLEX_TYPE, DOCUMENTATION, ELEMENT, FACET, GROUP, IDENTITY_FIELD, IDENTITY_SELECTOR, KEY, KEYREF, LIST, MODELGROUP, MODELGROUP_REF, REDEFINE, SCHEMA, SIMPLE_CONTENT, SIMPLE_TYPE, UNION, UNIQUE, UNKNOWN, WILDCARD
 
Constructor Summary
Facet(java.lang.String name, java.lang.String value)
          Creates a new Facet with the given name
 
Method Summary
 java.lang.String getName()
          Returns the name of this Facet
 short getStructureType()
          Returns the type of this Schema Structure
 java.lang.String getValue()
          Returns the character (String) representation of this facet
 boolean isMultivalued()
          Returns true if this Facet can occur more than once, such as the "enumeration" facet.
 byte toByte()
          Returns a byte representation of the value of this facet
 double toDouble()
          Returns a double representation of the value of this facet
 float toFloat()
          Returns a double representation of the value of this facet
 int toInt()
          Returns an int representation of the value of this facet
 long toLong()
          Returns a long representation of the value of this facet
 short toShort()
          Returns an short representation of the value of this facet
 void validate()
          Checks the validity of this Schema defintion.
 
Methods inherited from class org.exolab.castor.xml.schema.Annotated
addAnnotation, getAnnotations, removeAnnotation
 
Methods inherited from class org.exolab.castor.xml.schema.Structure
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENUMERATION

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

LENGTH

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

PATTERN

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

PRECISION

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

MAX_EXCLUSIVE

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

MAX_INCLUSIVE

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

MIN_EXCLUSIVE

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

MIN_INCLUSIVE

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

MAX_LENGTH

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

MIN_LENGTH

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

WHITESPACE

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

TOTALDIGITS

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

FRACTIONDIGITS

public static final java.lang.String FRACTIONDIGITS
See Also:
Constant Field Values
Constructor Detail

Facet

public Facet(java.lang.String name,
             java.lang.String value)
Creates a new Facet with the given name

Parameters:
name - the name of the Facet
value - the value of the Facet
Method Detail

getName

public java.lang.String getName()
Returns the name of this Facet

Returns:
the name of this Facet

getValue

public java.lang.String getValue()
Returns the character (String) representation of this facet

Returns:
the value of this facet

isMultivalued

public boolean isMultivalued()
Returns true if this Facet can occur more than once, such as the "enumeration" facet.

Returns:
true if this Facet can occur more than once.

toInt

public int toInt()
          throws java.lang.NumberFormatException
Returns an int representation of the value of this facet

Returns:
an int representation of the value of this facet
Throws:
java.lang.NumberFormatException

toLong

public long toLong()
            throws java.lang.NumberFormatException
Returns a long representation of the value of this facet

Returns:
a long representation of the value of this facet
Throws:
java.lang.NumberFormatException

toShort

public short toShort()
              throws java.lang.NumberFormatException
Returns an short representation of the value of this facet

Returns:
an short representation of the value of this facet
Throws:
java.lang.NumberFormatException

toFloat

public float toFloat()
              throws java.lang.NumberFormatException
Returns a double representation of the value of this facet

Returns:
a double representation of the value of this facet
Throws:
java.lang.NumberFormatException

toDouble

public double toDouble()
                throws java.lang.NumberFormatException
Returns a double representation of the value of this facet

Returns:
a double representation of the value of this facet
Throws:
java.lang.NumberFormatException

toByte

public byte toByte()
            throws java.lang.NumberFormatException
Returns a byte representation of the value of this facet

Returns:
a byte representation of the value of this facet
Throws:
java.lang.NumberFormatException

getStructureType

public short getStructureType()
Returns the type of this Schema Structure

Specified by:
getStructureType in class Structure
Returns:
the type of this Schema Structure

validate

public void validate()
              throws ValidationException
Checks the validity of this Schema defintion.

Specified by:
validate in class Structure
Throws:
ValidationException - when this Schema definition is invalid.


Intalio Inc. (C) 1999-2004. All rights reserved http://www.intalio.com