|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exolab.castor.xml.schema.Structure
org.exolab.castor.xml.schema.Annotated
org.exolab.castor.xml.schema.Facet
public class Facet
Represents the base type for XML Schema Facets
| 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
|
static String |
WHITESPACE_COLLAPSE
|
static String |
WHITESPACE_PRESERVE
|
static String |
WHITESPACE_REPLACE
|
| 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 | |
|---|---|
void |
checkConstraints(Enumeration localFacets,
Enumeration baseFacets)
Checks the constraints on the current facet against the other local facets of the same derived data type and facets of the base data type. |
String |
getName()
Returns the name of this Facet. |
SimpleType |
getOwningType()
Returns the owning SimpleType instance. |
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. |
boolean |
overridesBase(Facet baseFacet)
Checks whether the current facet overrides a facet of the base data type. |
void |
setOwningType(SimpleType owningType)
Sets the owning SimpleType instance. |
BigDecimal |
toBigDecimal()
Returns a BigDecimal representation of the value of this 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 |
|---|
public static final String ENUMERATION
public static final String LENGTH
public static final String PATTERN
public static final String PRECISION
public static final String MAX_EXCLUSIVE
public static final String MAX_INCLUSIVE
public static final String MIN_EXCLUSIVE
public static final String MIN_INCLUSIVE
public static final String MAX_LENGTH
public static final String MIN_LENGTH
public static final String WHITESPACE
public static final String TOTALDIGITS
public static final String FRACTIONDIGITS
public static final String WHITESPACE_PRESERVE
public static final String WHITESPACE_REPLACE
public static final String WHITESPACE_COLLAPSE
| Constructor Detail |
|---|
public Facet(String name,
String value)
name - the name of the Facetvalue - the value of the Facet| Method Detail |
|---|
public String getName()
public String getValue()
public boolean isMultivalued()
public int toInt()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a int.
public long toLong()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a long.
public short toShort()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a short.
public float toFloat()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a float.
public double toDouble()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a double.
public byte toByte()
throws NumberFormatException
NumberFormatException - if the value fails to parse as a byte.
public BigDecimal toBigDecimal()
throws NumberFormatException
BigDecimal representation of the value of this facet.
BigDecimal representation of the value of this facet
NumberFormatException - if the value cannot be parsed as numberpublic short getStructureType()
getStructureType in class Structure
public void validate()
throws ValidationException
validate in class StructureValidationException - when this Schema definition
is invalid.public boolean overridesBase(Facet baseFacet)
This method is used for merging facets of the base and derived types, in order to create an effective set of facets for the derived type.
It's important to note that this method does not perform any validity checks. Validation must be generally performed before trying to merge facets of the base and derived types.
baseFacet - a facet of the base data type
true,
if the current facet overrides baseFacet;
false, otherwise.checkConstraints(Enumeration,Enumeration),
SimpleType.getEffectiveFacets()
public void checkConstraints(Enumeration localFacets,
Enumeration baseFacets)
throws SchemaException
localFacets - local facets of the data typebaseFacets - merged facets of the base data type
SchemaException - when the current facet does not satisfy
schema component validation constraintspublic void setOwningType(SimpleType owningType)
SimpleType instance.
owningType - The owning SimpleType instance.public SimpleType getOwningType()
SimpleType instance.
SimpleType instance.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||