org.exolab.castor.xml.schema

Class Facet

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 String
ENUMERATION
static String
FRACTIONDIGITS
static String
LENGTH
static String
MAX_EXCLUSIVE
static String
MAX_INCLUSIVE
static String
MAX_LENGTH
static String
MIN_EXCLUSIVE
static String
MIN_INCLUSIVE
static String
MIN_LENGTH
static String
PATTERN
static String
PRECISION
static String
TOTALDIGITS
static 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(String name, String value)
Creates a new Facet with the given name

Method Summary

String
getName()
Returns the name of this Facet
short
getStructureType()
Returns the type of this Schema Structure
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

getStructureType, isValid, validate

Field Details

ENUMERATION

public static final String ENUMERATION

FRACTIONDIGITS

public static final String FRACTIONDIGITS

LENGTH

public static final String LENGTH

MAX_EXCLUSIVE

public static final String MAX_EXCLUSIVE

MAX_INCLUSIVE

public static final String MAX_INCLUSIVE

MAX_LENGTH

public static final String MAX_LENGTH

MIN_EXCLUSIVE

public static final String MIN_EXCLUSIVE

MIN_INCLUSIVE

public static final String MIN_INCLUSIVE

MIN_LENGTH

public static final String MIN_LENGTH

PATTERN

public static final String PATTERN

PRECISION

public static final String PRECISION

TOTALDIGITS

public static final String TOTALDIGITS

WHITESPACE

public static final String WHITESPACE

Constructor Details

Facet

public Facet(String name,
             String value)
Creates a new Facet with the given name
Parameters:
name - the name of the Facet
value - the value of the Facet

Method Details

getName

public String getName()
Returns the name of this Facet
Returns:
the name of this Facet

getStructureType

public short getStructureType()
Returns the type of this Schema Structure
Overrides:
getStructureType in interface Structure
Returns:
the type of this Schema Structure

getValue

public 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.

toByte

public byte toByte()
            throws NumberFormatException
Returns a byte representation of the value of this facet
Returns:
a byte representation of the value of this facet

toDouble

public double toDouble()
            throws NumberFormatException
Returns a double representation of the value of this facet
Returns:
a double representation of the value of this facet

toFloat

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

toInt

public int toInt()
            throws NumberFormatException
Returns an int representation of the value of this facet
Returns:
an int representation of the value of this facet

toLong

public long toLong()
            throws NumberFormatException
Returns a long representation of the value of this facet
Returns:
a long representation of the value of this facet

toShort

public short toShort()
            throws NumberFormatException
Returns an short representation of the value of this facet
Returns:
an short representation of the value of this facet

validate

public void validate()
            throws ValidationException
Checks the validity of this Schema defintion.
Overrides:
validate in interface Structure
Throws:
ValidationException - when this Schema definition is invalid.

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