org.apache.xerces.impl.dv

Interface XSSimpleType

All Superinterfaces:
org.apache.xerces.xs.XSObject, org.apache.xerces.xs.XSSimpleTypeDefinition, org.apache.xerces.xs.XSTypeDefinition
Known Implementing Classes:
XSSimpleTypeDecl

public interface XSSimpleType
extends org.apache.xerces.xs.XSSimpleTypeDefinition

This interface XSSimpleType represents the simple type definition of schema component and defines methods to query the information contained. Any simple type (atomic, list or union) will implement this interface. It inherits from XSTypeDecl.
Version:
$Id: XSSimpleType.java,v 1.17 2004/10/06 14:56:50 mrglavas Exp $
Author:
Sandy Gao, IBM

Field Summary

static short
PRIMITIVE_ANYURI
"anyURI" type
static short
PRIMITIVE_BASE64BINARY
"base64Binary" type
static short
PRIMITIVE_BOOLEAN
"boolean" type
static short
PRIMITIVE_DATE
"date" type
static short
PRIMITIVE_DATETIME
"dataTime" type
static short
PRIMITIVE_DECIMAL
"decimal" type
static short
PRIMITIVE_DOUBLE
"double" type
static short
PRIMITIVE_DURATION
"duration" type
static short
PRIMITIVE_FLOAT
"float" type
static short
PRIMITIVE_GDAY
"gDay" type
static short
PRIMITIVE_GMONTH
"gMonth" type
static short
PRIMITIVE_GMONTHDAY
"gMonthDay" type
static short
PRIMITIVE_GYEAR
"gYear" type
static short
PRIMITIVE_GYEARMONTH
"gYearMonth" type
static short
PRIMITIVE_HEXBINARY
"hexBinary" type
static short
PRIMITIVE_NOTATION
"NOTATION" type
static short
PRIMITIVE_PRECISIONDECIMAL
"precisionDecimal" type
static short
PRIMITIVE_QNAME
"QName" type
static short
PRIMITIVE_STRING
"string" type
static short
PRIMITIVE_TIME
"time" type
static short
WS_COLLAPSE
collapse the white spaces
static short
WS_PRESERVE
preserve the white spaces
static short
WS_REPLACE
replace the white spaces

Fields inherited from interface org.apache.xerces.xs.XSSimpleTypeDefinition

FACET_ENUMERATION, FACET_FRACTIONDIGITS, FACET_LENGTH, FACET_MAXEXCLUSIVE, FACET_MAXINCLUSIVE, FACET_MAXLENGTH, FACET_MINEXCLUSIVE, FACET_MININCLUSIVE, FACET_MINLENGTH, FACET_NONE, FACET_PATTERN, FACET_TOTALDIGITS, FACET_WHITESPACE, ORDERED_FALSE, ORDERED_PARTIAL, ORDERED_TOTAL, VARIETY_ABSENT, VARIETY_ATOMIC, VARIETY_LIST, VARIETY_UNION

Method Summary

void
applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
If this type is created from restriction, then some facets can be applied to the simple type.
short
getPrimitiveKind()
return an ID representing the built-in primitive base type.
short
getWhitespace()
Return the whitespace corresponding to this datatype.
boolean
isEqual(Object value1, Object value2)
Check whether two actual values are equal.
boolean
isIDType()
Check whether this type is or is derived from ID.
Object
validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a given string value, represented by content.toString().
Object
validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a given string against this simple type.
void
validate(ValidationContext context, ValidatedInfo validatedInfo)
Validate an actual value against this simple type.

Methods inherited from interface org.apache.xerces.xs.XSObject

getName, getNamespace, getNamespaceItem, getType

Methods inherited from interface org.apache.xerces.xs.XSSimpleTypeDefinition

getAnnotations, getBounded, getBuiltInKind, getDefinedFacets, getFacets, getFinite, getFixedFacets, getItemType, getLexicalEnumeration, getLexicalFacetValue, getLexicalPattern, getMemberTypes, getMultiValueFacets, getNumeric, getOrdered, getPrimitiveType, getVariety, isDefinedFacet, isFixedFacet

Methods inherited from interface org.apache.xerces.xs.XSTypeDefinition

derivedFrom, derivedFromType, getAnonymous, getBaseType, getFinal, getTypeCategory, isFinal

Field Details

PRIMITIVE_ANYURI

public static final short PRIMITIVE_ANYURI
"anyURI" type
Field Value:
17

PRIMITIVE_BASE64BINARY

public static final short PRIMITIVE_BASE64BINARY
"base64Binary" type
Field Value:
16

PRIMITIVE_BOOLEAN

public static final short PRIMITIVE_BOOLEAN
"boolean" type
Field Value:
2

PRIMITIVE_DATE

public static final short PRIMITIVE_DATE
"date" type
Field Value:
9

PRIMITIVE_DATETIME

public static final short PRIMITIVE_DATETIME
"dataTime" type
Field Value:
7

PRIMITIVE_DECIMAL

public static final short PRIMITIVE_DECIMAL
"decimal" type
Field Value:
3

PRIMITIVE_DOUBLE

public static final short PRIMITIVE_DOUBLE
"double" type
Field Value:
5

PRIMITIVE_DURATION

public static final short PRIMITIVE_DURATION
"duration" type
Field Value:
6

PRIMITIVE_FLOAT

public static final short PRIMITIVE_FLOAT
"float" type
Field Value:
4

PRIMITIVE_GDAY

public static final short PRIMITIVE_GDAY
"gDay" type
Field Value:
13

PRIMITIVE_GMONTH

public static final short PRIMITIVE_GMONTH
"gMonth" type
Field Value:
14

PRIMITIVE_GMONTHDAY

public static final short PRIMITIVE_GMONTHDAY
"gMonthDay" type
Field Value:
12

PRIMITIVE_GYEAR

public static final short PRIMITIVE_GYEAR
"gYear" type
Field Value:
11

PRIMITIVE_GYEARMONTH

public static final short PRIMITIVE_GYEARMONTH
"gYearMonth" type
Field Value:
10

PRIMITIVE_HEXBINARY

public static final short PRIMITIVE_HEXBINARY
"hexBinary" type
Field Value:
15

PRIMITIVE_NOTATION

public static final short PRIMITIVE_NOTATION
"NOTATION" type
Field Value:
20

PRIMITIVE_PRECISIONDECIMAL

public static final short PRIMITIVE_PRECISIONDECIMAL
"precisionDecimal" type
Field Value:
19

PRIMITIVE_QNAME

public static final short PRIMITIVE_QNAME
"QName" type
Field Value:
18

PRIMITIVE_STRING

public static final short PRIMITIVE_STRING
"string" type
Field Value:
1

PRIMITIVE_TIME

public static final short PRIMITIVE_TIME
"time" type
Field Value:
8

WS_COLLAPSE

public static final short WS_COLLAPSE
collapse the white spaces
Field Value:
2

WS_PRESERVE

public static final short WS_PRESERVE
preserve the white spaces
Field Value:
0

WS_REPLACE

public static final short WS_REPLACE
replace the white spaces
Field Value:
1

Method Details

applyFacets

public void applyFacets(XSFacets facets,
                        short presentFacet,
                        short fixedFacet,
                        ValidationContext context)
            throws InvalidDatatypeFacetException
If this type is created from restriction, then some facets can be applied to the simple type. XSFacets is used to pass the value of different facets.
Parameters:
facets - the value of all the facets
presentFacet - bit combination value of the costraining facet constants which are present.
fixedFacet - bit combination value of the costraining facet constants which are fixed.
context - the validation context
Throws:
InvalidDatatypeFacetException - exception for invalid facet values.

getPrimitiveKind

public short getPrimitiveKind()
return an ID representing the built-in primitive base type. REVISIT: This method is (currently) for internal use only. the constants returned from this method are not finalized yet. the names and values might change in the further.
Returns:
an ID representing the built-in primitive base type

getWhitespace

public short getWhitespace()
            throws DatatypeException
Return the whitespace corresponding to this datatype.
Returns:
valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.
Throws:
DatatypeException - union datatypes don't have whitespace facet associated with them

isEqual

public boolean isEqual(Object value1,
                       Object value2)
Check whether two actual values are equal.
Parameters:
value1 - the first value
value2 - the second value
Returns:
true if the two value are equal

isIDType

public boolean isIDType()
Check whether this type is or is derived from ID. REVISIT: this method makes ID special, which is not a good design. but since ID is not a primitive, there doesn't seem to be a clean way of doing it except to define special method like this.
Returns:
whether this simple type is or is derived from ID.

validate

public Object validate(Object content,
                       ValidationContext context,
                       ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
validate a given string value, represented by content.toString(). note that if content is a StringBuffer, for performance reasons, it's possible that the content of the string buffer is modified.
Parameters:
content - the string value that needs to be validated
context - the validation context
validatedInfo - used to store validation result
Returns:
the actual value (QName, Boolean) of the string value

validate

public Object validate(String content,
                       ValidationContext context,
                       ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
validate a given string against this simple type.
Parameters:
content - the string value that needs to be validated
context - the validation context
validatedInfo - used to store validation result
Returns:
the actual value (QName, Boolean) of the string value

validate

public void validate(ValidationContext context,
                     ValidatedInfo validatedInfo)
            throws InvalidDatatypeValueException
Validate an actual value against this simple type.
Parameters:
context - the validation context
validatedInfo - used to provide the actual value and member types
Throws:
InvalidDatatypeValueException - exception for invalid values.

Copyright B) 1999-2005 Apache XML Project. All Rights Reserved.