public interface

XSSimpleType

implements XSSimpleTypeDefinition
org.apache.xerces.impl.dv.XSSimpleType
Known Indirect Subclasses

Class Overview

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.

Summary

Constants
short PRIMITIVE_ANYURI "anyURI" type
short PRIMITIVE_BASE64BINARY "base64Binary" type
short PRIMITIVE_BOOLEAN "boolean" type
short PRIMITIVE_DATE "date" type
short PRIMITIVE_DATETIME "dataTime" type
short PRIMITIVE_DECIMAL "decimal" type
short PRIMITIVE_DOUBLE "double" type
short PRIMITIVE_DURATION "duration" type
short PRIMITIVE_FLOAT "float" type
short PRIMITIVE_GDAY "gDay" type
short PRIMITIVE_GMONTH "gMonth" type
short PRIMITIVE_GMONTHDAY "gMonthDay" type
short PRIMITIVE_GYEAR "gYear" type
short PRIMITIVE_GYEARMONTH "gYearMonth" type
short PRIMITIVE_HEXBINARY "hexBinary" type
short PRIMITIVE_NOTATION "NOTATION" type
short PRIMITIVE_PRECISIONDECIMAL "precisionDecimal" type
short PRIMITIVE_QNAME "QName" type
short PRIMITIVE_STRING "string" type
short PRIMITIVE_TIME "time" type
short WS_COLLAPSE collapse the white spaces
short WS_PRESERVE preserve the white spaces
short WS_REPLACE replace the white spaces
[Expand]
Inherited Constants
From interface org.apache.xerces.xs.XSSimpleTypeDefinition
From interface org.apache.xerces.xs.XSTypeDefinition
Public Methods
abstract 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.
abstract short getPrimitiveKind()
return an ID representing the built-in primitive base type.
abstract short getWhitespace()
Return the whitespace corresponding to this datatype.
abstract boolean isEqual(Object value1, Object value2)
Check whether two actual values are equal.
abstract boolean isIDType()
Check whether this type is or is derived from ID.
abstract Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a given string value, represented by content.toString().
abstract Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a given string against this simple type.
abstract void validate(ValidationContext context, ValidatedInfo validatedInfo)
Validate an actual value against this simple type.
[Expand]
Inherited Methods
From interface org.apache.xerces.xs.XSObject
From interface org.apache.xerces.xs.XSSimpleTypeDefinition
From interface org.apache.xerces.xs.XSTypeDefinition

Constants

public static final short PRIMITIVE_ANYURI

"anyURI" type

Constant Value: 17 (0x00000011)

public static final short PRIMITIVE_BASE64BINARY

"base64Binary" type

Constant Value: 16 (0x00000010)

public static final short PRIMITIVE_BOOLEAN

"boolean" type

Constant Value: 2 (0x00000002)

public static final short PRIMITIVE_DATE

"date" type

Constant Value: 9 (0x00000009)

public static final short PRIMITIVE_DATETIME

"dataTime" type

Constant Value: 7 (0x00000007)

public static final short PRIMITIVE_DECIMAL

"decimal" type

Constant Value: 3 (0x00000003)

public static final short PRIMITIVE_DOUBLE

"double" type

Constant Value: 5 (0x00000005)

public static final short PRIMITIVE_DURATION

"duration" type

Constant Value: 6 (0x00000006)

public static final short PRIMITIVE_FLOAT

"float" type

Constant Value: 4 (0x00000004)

public static final short PRIMITIVE_GDAY

"gDay" type

Constant Value: 13 (0x0000000d)

public static final short PRIMITIVE_GMONTH

"gMonth" type

Constant Value: 14 (0x0000000e)

public static final short PRIMITIVE_GMONTHDAY

"gMonthDay" type

Constant Value: 12 (0x0000000c)

public static final short PRIMITIVE_GYEAR

"gYear" type

Constant Value: 11 (0x0000000b)

public static final short PRIMITIVE_GYEARMONTH

"gYearMonth" type

Constant Value: 10 (0x0000000a)

public static final short PRIMITIVE_HEXBINARY

"hexBinary" type

Constant Value: 15 (0x0000000f)

public static final short PRIMITIVE_NOTATION

"NOTATION" type

Constant Value: 20 (0x00000014)

public static final short PRIMITIVE_PRECISIONDECIMAL

"precisionDecimal" type

Constant Value: 19 (0x00000013)

public static final short PRIMITIVE_QNAME

"QName" type

Constant Value: 18 (0x00000012)

public static final short PRIMITIVE_STRING

"string" type

Constant Value: 1 (0x00000001)

public static final short PRIMITIVE_TIME

"time" type

Constant Value: 8 (0x00000008)

public static final short WS_COLLAPSE

collapse the white spaces

Constant Value: 2 (0x00000002)

public static final short WS_PRESERVE

preserve the white spaces

Constant Value: 0 (0x00000000)

public static final short WS_REPLACE

replace the white spaces

Constant Value: 1 (0x00000001)

Public Methods

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

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

public abstract short getWhitespace ()

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

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

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

public abstract Object validate (Object content, ValidationContext context, ValidatedInfo validatedInfo)

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

public abstract Object validate (String content, ValidationContext context, ValidatedInfo validatedInfo)

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

public abstract void validate (ValidationContext context, ValidatedInfo validatedInfo)

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.