org.apache.xerces.impl.dv

Interface XSSimpleType

public interface XSSimpleType extends 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

UNKNOWN:

Field Summary
static shortPRIMITIVE_ANYURI
"anyURI" type
static shortPRIMITIVE_BASE64BINARY
"base64Binary" type
static shortPRIMITIVE_BOOLEAN
"boolean" type
static shortPRIMITIVE_DATE
"date" type
static shortPRIMITIVE_DATETIME
"dataTime" type
static shortPRIMITIVE_DECIMAL
"decimal" type
static shortPRIMITIVE_DOUBLE
"double" type
static shortPRIMITIVE_DURATION
"duration" type
static shortPRIMITIVE_FLOAT
"float" type
static shortPRIMITIVE_GDAY
"gDay" type
static shortPRIMITIVE_GMONTH
"gMonth" type
static shortPRIMITIVE_GMONTHDAY
"gMonthDay" type
static shortPRIMITIVE_GYEAR
"gYear" type
static shortPRIMITIVE_GYEARMONTH
"gYearMonth" type
static shortPRIMITIVE_HEXBINARY
"hexBinary" type
static shortPRIMITIVE_NOTATION
"NOTATION" type
static shortPRIMITIVE_PRECISIONDECIMAL
"precisionDecimal" type
static shortPRIMITIVE_QNAME
"QName" type
static shortPRIMITIVE_STRING
"string" type
static shortPRIMITIVE_TIME
"time" type
static shortWS_COLLAPSE
collapse the white spaces
static shortWS_PRESERVE
preserve the white spaces
static shortWS_REPLACE
replace the white spaces
Method Summary
voidapplyFacets(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.
shortgetPrimitiveKind()
return an ID representing the built-in primitive base type.
shortgetWhitespace()
Return the whitespace corresponding to this datatype.
booleanisEqual(Object value1, Object value2)
Check whether two actual values are equal.
booleanisIDType()
Check whether this type is or is derived from ID.
Objectvalidate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a given string against this simple type.
Objectvalidate(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.
voidvalidate(ValidationContext context, ValidatedInfo validatedInfo)
Validate an actual value against this simple type.

Field Detail

PRIMITIVE_ANYURI

public static final short PRIMITIVE_ANYURI
"anyURI" type

PRIMITIVE_BASE64BINARY

public static final short PRIMITIVE_BASE64BINARY
"base64Binary" type

PRIMITIVE_BOOLEAN

public static final short PRIMITIVE_BOOLEAN
"boolean" type

PRIMITIVE_DATE

public static final short PRIMITIVE_DATE
"date" type

PRIMITIVE_DATETIME

public static final short PRIMITIVE_DATETIME
"dataTime" type

PRIMITIVE_DECIMAL

public static final short PRIMITIVE_DECIMAL
"decimal" type

PRIMITIVE_DOUBLE

public static final short PRIMITIVE_DOUBLE
"double" type

PRIMITIVE_DURATION

public static final short PRIMITIVE_DURATION
"duration" type

PRIMITIVE_FLOAT

public static final short PRIMITIVE_FLOAT
"float" type

PRIMITIVE_GDAY

public static final short PRIMITIVE_GDAY
"gDay" type

PRIMITIVE_GMONTH

public static final short PRIMITIVE_GMONTH
"gMonth" type

PRIMITIVE_GMONTHDAY

public static final short PRIMITIVE_GMONTHDAY
"gMonthDay" type

PRIMITIVE_GYEAR

public static final short PRIMITIVE_GYEAR
"gYear" type

PRIMITIVE_GYEARMONTH

public static final short PRIMITIVE_GYEARMONTH
"gYearMonth" type

PRIMITIVE_HEXBINARY

public static final short PRIMITIVE_HEXBINARY
"hexBinary" type

PRIMITIVE_NOTATION

public static final short PRIMITIVE_NOTATION
"NOTATION" type

PRIMITIVE_PRECISIONDECIMAL

public static final short PRIMITIVE_PRECISIONDECIMAL
"precisionDecimal" type

PRIMITIVE_QNAME

public static final short PRIMITIVE_QNAME
"QName" type

PRIMITIVE_STRING

public static final short PRIMITIVE_STRING
"string" type

PRIMITIVE_TIME

public static final short PRIMITIVE_TIME
"time" type

WS_COLLAPSE

public static final short WS_COLLAPSE
collapse the white spaces

WS_PRESERVE

public static final short WS_PRESERVE
preserve the white spaces

WS_REPLACE

public static final short WS_REPLACE
replace the white spaces

Method Detail

applyFacets

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

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()
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(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

validate

public 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

validate

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

Copyright © 1999-2005 Apache XML Project. All Rights Reserved.