Class XSSimpleTypeDecl
- java.lang.Object
-
- org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.dv.xs.XSSimpleTypeDecl
-
- All Implemented Interfaces:
XSSimpleType
,XSObject
,XSSimpleTypeDefinition
,XSTypeDefinition
,TypeInfo
public class XSSimpleTypeDecl extends Object implements XSSimpleType, TypeInfo
- Version:
- $Id$
- Author:
- Sandy Gao, IBM, Neeraj Bajaj, Sun Microsystems, inc.
-
-
Field Summary
Fields Modifier and Type Field Description static short
ANYATOMICTYPE_DT
static short
DAYTIMEDURATION_DT
protected static short
DV_ANYATOMICTYPE
protected static short
DV_ANYSIMPLETYPE
protected static short
DV_ANYURI
protected static short
DV_BASE64BINARY
protected static short
DV_BOOLEAN
protected static short
DV_DATE
protected static short
DV_DATETIME
protected static short
DV_DAYTIMEDURATION
protected static short
DV_DECIMAL
protected static short
DV_DOUBLE
protected static short
DV_DURATION
protected static short
DV_ENTITY
protected static short
DV_FLOAT
protected static short
DV_GDAY
protected static short
DV_GMONTH
protected static short
DV_GMONTHDAY
protected static short
DV_GYEAR
protected static short
DV_GYEARMONTH
protected static short
DV_HEXBINARY
protected static short
DV_ID
protected static short
DV_IDREF
protected static short
DV_INTEGER
protected static short
DV_LIST
protected static short
DV_NOTATION
protected static short
DV_PRECISIONDECIMAL
protected static short
DV_QNAME
protected static short
DV_STRING
protected static short
DV_TIME
protected static short
DV_UNION
protected static short
DV_YEARMONTHDURATION
XSObjectList
enumerationAnnotations
XSAnnotation
fractionDigitsAnnotation
XSAnnotation
lengthAnnotation
XSAnnotation
maxExclusiveAnnotation
XSAnnotation
maxInclusiveAnnotation
XSAnnotation
maxLengthAnnotation
XSAnnotation
minExclusiveAnnotation
XSAnnotation
minInclusiveAnnotation
XSAnnotation
minLengthAnnotation
XSObjectListImpl
patternAnnotations
static short
PRECISIONDECIMAL_DT
XSAnnotation
totalDigitsAnnotation
XSAnnotation
whiteSpaceAnnotation
static short
YEARMONTHDURATION_DT
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.impl.dv.XSSimpleType
PRIMITIVE_ANYURI, PRIMITIVE_BASE64BINARY, PRIMITIVE_BOOLEAN, PRIMITIVE_DATE, PRIMITIVE_DATETIME, PRIMITIVE_DECIMAL, PRIMITIVE_DOUBLE, PRIMITIVE_DURATION, PRIMITIVE_FLOAT, PRIMITIVE_GDAY, PRIMITIVE_GMONTH, PRIMITIVE_GMONTHDAY, PRIMITIVE_GYEAR, PRIMITIVE_GYEARMONTH, PRIMITIVE_HEXBINARY, PRIMITIVE_NOTATION, PRIMITIVE_PRECISIONDECIMAL, PRIMITIVE_QNAME, PRIMITIVE_STRING, PRIMITIVE_TIME, WS_COLLAPSE, WS_PRESERVE, WS_REPLACE
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.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
-
Fields inherited from interface org.smooks.engine.delivery.sax.ng.org.apache.xerces.xs.XSTypeDefinition
COMPLEX_TYPE, SIMPLE_TYPE
-
-
Constructor Summary
Constructors Modifier Constructor Description XSSimpleTypeDecl()
protected
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
protected
XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)
protected
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV, short ordered, boolean bounded, boolean finite, boolean numeric, boolean isImmutable, short builtInKind)
protected
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)
protected
XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations, short builtInKind)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
Ifis chosen boolean
derivedFrom(String ancestorNS, String ancestorName, short derivation)
Convenience method which checks if this type is derived from the given ancestor type.boolean
derivedFromType(XSTypeDefinition ancestor, short derivation)
Convenience method which checks if this type is derived from the givenancestorType
.ObjectList
getActualEnumeration()
A list of actual enumeration values if it exists, otherwise an emptyObjectList
.protected ValidatedInfo
getActualEnumValue(String lexical, ValidationContext ctx, ValidatedInfo info)
XSObjectList
getAnnotations()
[annotations]: a set of annotations for this simple type component if it exists, otherwise an emptyXSObjectList
.boolean
getAnonymous()
Convenience attribute.XSTypeDefinition
getBaseType()
{base type definition}: either a simple type definition or a complex type definition.boolean
getBounded()
Fundamental Facet: bounded.short
getBuiltInKind()
Returns the closest built-in type category this type represents or derived from.short
getDefinedFacets()
[facets]: all facets defined on this type.ObjectList
getEnumerationItemTypeList()
A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns nullShortList
getEnumerationTypeList()
XSObject
getFacet(int facetType)
A constraining facet object.XSObjectList
getFacets()
A list of constraining facets if it exists, otherwise an emptyXSObjectList
.short
getFinal()
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION
} corresponding tofinal
set of this type orDERIVATION_NONE
.boolean
getFinite()
Fundamental Facet: cardinality.short
getFixedFacets()
[facets]: all defined facets for this type which are fixed.protected static TypeValidator[]
getGDVs()
XSSimpleTypeDefinition
getItemType()
If variety islist
the item type definition (an atomic or union simple type definition) is available, otherwisenull
.StringList
getLexicalEnumeration()
A list of enumeration values if it exists, otherwise an emptyStringList
.String
getLexicalFacetValue(short facetName)
Convenience method.StringList
getLexicalPattern()
A list of pattern values if it exists, otherwise an emptyStringList
.Object
getMaxExclusiveValue()
Object
getMaxInclusiveValue()
XSObjectList
getMemberTypes()
If variety isunion
the list of member type definitions (a non-empty sequence of simple type definitions) is available, otherwise an emptyXSObjectList
.Object
getMinExclusiveValue()
Object
getMinInclusiveValue()
XSObjectList
getMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists, otherwise an emptyXSObjectList
.String
getName()
The name of typeNCName
, as defined in XML Namespaces, of this declaration specified in the{name}
property of the component ornull
if the definition of this component does not have a{name}
property.String
getNamespace()
The [target namespace] of this object, ornull
if it is unspecified.XSNamespaceItem
getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornull
otherwise.boolean
getNumeric()
Fundamental Facet: numeric.short
getOrdered()
Fundamental Facet: ordered.short
getPrimitiveKind()
return an ID representing the built-in primitive base type.XSSimpleTypeDefinition
getPrimitiveType()
If variety isatomic
the primitive type definition (a built-in primitive datatype definition or the simple ur-type definition) is available, otherwisenull
.short
getType()
Thetype
of this object, i.e.short
getTypeCategory()
Return whether this type definition is a simple type or complex type.String
getTypeName()
String
getTypeNamespace()
short
getVariety()
[variety]: one of {atomic, list, union} or absent.short
getWhitespace()
Return the whitespace corresponding to this datatype.boolean
isDefinedFacet(short facetName)
Convenience method.boolean
isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
boolean
isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
Checks if a type is derived from another by restriction, given the name and namespace.boolean
isEqual(Object value1, Object value2)
Check whether two actual values are equal.boolean
isFinal(short derivation)
{final}.boolean
isFixedFacet(short facetName)
Convenience method.boolean
isIdentical(Object value1, Object value2)
boolean
isIDType()
Check whether this type is or is derived from ID.protected String
normalize(Object content, short ws)
static String
normalize(String content, short ws)
void
reset()
void
setAnonymous(boolean anon)
protected void
setDVs(TypeValidator[] dvs)
protected XSSimpleTypeDecl
setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)
void
setNamespaceItem(XSNamespaceItem namespaceItem)
protected XSSimpleTypeDecl
setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)
protected XSSimpleTypeDecl
setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
String
toString()
Object
validate(Object content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled formObject
validate(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled formvoid
validate(ValidationContext context, ValidatedInfo validatedInfo)
validate an actual value against this DVValidatedInfo
validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo)
validate a value, and return the compiled form
-
-
-
Field Detail
-
DV_STRING
protected static final short DV_STRING
- See Also:
- Constant Field Values
-
DV_BOOLEAN
protected static final short DV_BOOLEAN
- See Also:
- Constant Field Values
-
DV_DECIMAL
protected static final short DV_DECIMAL
- See Also:
- Constant Field Values
-
DV_FLOAT
protected static final short DV_FLOAT
- See Also:
- Constant Field Values
-
DV_DOUBLE
protected static final short DV_DOUBLE
- See Also:
- Constant Field Values
-
DV_DURATION
protected static final short DV_DURATION
- See Also:
- Constant Field Values
-
DV_DATETIME
protected static final short DV_DATETIME
- See Also:
- Constant Field Values
-
DV_TIME
protected static final short DV_TIME
- See Also:
- Constant Field Values
-
DV_DATE
protected static final short DV_DATE
- See Also:
- Constant Field Values
-
DV_GYEARMONTH
protected static final short DV_GYEARMONTH
- See Also:
- Constant Field Values
-
DV_GYEAR
protected static final short DV_GYEAR
- See Also:
- Constant Field Values
-
DV_GMONTHDAY
protected static final short DV_GMONTHDAY
- See Also:
- Constant Field Values
-
DV_GDAY
protected static final short DV_GDAY
- See Also:
- Constant Field Values
-
DV_GMONTH
protected static final short DV_GMONTH
- See Also:
- Constant Field Values
-
DV_HEXBINARY
protected static final short DV_HEXBINARY
- See Also:
- Constant Field Values
-
DV_BASE64BINARY
protected static final short DV_BASE64BINARY
- See Also:
- Constant Field Values
-
DV_ANYURI
protected static final short DV_ANYURI
- See Also:
- Constant Field Values
-
DV_QNAME
protected static final short DV_QNAME
- See Also:
- Constant Field Values
-
DV_PRECISIONDECIMAL
protected static final short DV_PRECISIONDECIMAL
- See Also:
- Constant Field Values
-
DV_NOTATION
protected static final short DV_NOTATION
- See Also:
- Constant Field Values
-
DV_ANYSIMPLETYPE
protected static final short DV_ANYSIMPLETYPE
- See Also:
- Constant Field Values
-
DV_ID
protected static final short DV_ID
- See Also:
- Constant Field Values
-
DV_IDREF
protected static final short DV_IDREF
- See Also:
- Constant Field Values
-
DV_ENTITY
protected static final short DV_ENTITY
- See Also:
- Constant Field Values
-
DV_INTEGER
protected static final short DV_INTEGER
- See Also:
- Constant Field Values
-
DV_LIST
protected static final short DV_LIST
- See Also:
- Constant Field Values
-
DV_UNION
protected static final short DV_UNION
- See Also:
- Constant Field Values
-
DV_YEARMONTHDURATION
protected static final short DV_YEARMONTHDURATION
- See Also:
- Constant Field Values
-
DV_DAYTIMEDURATION
protected static final short DV_DAYTIMEDURATION
- See Also:
- Constant Field Values
-
DV_ANYATOMICTYPE
protected static final short DV_ANYATOMICTYPE
- See Also:
- Constant Field Values
-
YEARMONTHDURATION_DT
public static final short YEARMONTHDURATION_DT
- See Also:
- Constant Field Values
-
DAYTIMEDURATION_DT
public static final short DAYTIMEDURATION_DT
- See Also:
- Constant Field Values
-
PRECISIONDECIMAL_DT
public static final short PRECISIONDECIMAL_DT
- See Also:
- Constant Field Values
-
ANYATOMICTYPE_DT
public static final short ANYATOMICTYPE_DT
- See Also:
- Constant Field Values
-
lengthAnnotation
public XSAnnotation lengthAnnotation
-
minLengthAnnotation
public XSAnnotation minLengthAnnotation
-
maxLengthAnnotation
public XSAnnotation maxLengthAnnotation
-
whiteSpaceAnnotation
public XSAnnotation whiteSpaceAnnotation
-
totalDigitsAnnotation
public XSAnnotation totalDigitsAnnotation
-
fractionDigitsAnnotation
public XSAnnotation fractionDigitsAnnotation
-
patternAnnotations
public XSObjectListImpl patternAnnotations
-
enumerationAnnotations
public XSObjectList enumerationAnnotations
-
maxInclusiveAnnotation
public XSAnnotation maxInclusiveAnnotation
-
maxExclusiveAnnotation
public XSAnnotation maxExclusiveAnnotation
-
minInclusiveAnnotation
public XSAnnotation minInclusiveAnnotation
-
minExclusiveAnnotation
public XSAnnotation minExclusiveAnnotation
-
-
Constructor Detail
-
XSSimpleTypeDecl
public XSSimpleTypeDecl()
-
XSSimpleTypeDecl
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, short validateDV, short ordered, boolean bounded, boolean finite, boolean numeric, boolean isImmutable, short builtInKind)
-
XSSimpleTypeDecl
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations, short builtInKind)
-
XSSimpleTypeDecl
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)
-
XSSimpleTypeDecl
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)
-
XSSimpleTypeDecl
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
-
-
Method Detail
-
getGDVs
protected static TypeValidator[] getGDVs()
-
setDVs
protected void setDVs(TypeValidator[] dvs)
-
setRestrictionValues
protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)
-
setListValues
protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)
-
setUnionValues
protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
-
getType
public short getType()
Description copied from interface:XSObject
Thetype
of this object, i.e.ELEMENT_DECLARATION
.
-
getTypeCategory
public short getTypeCategory()
Description copied from interface:XSTypeDefinition
Return whether this type definition is a simple type or complex type.- Specified by:
getTypeCategory
in interfaceXSTypeDefinition
-
getName
public String getName()
Description copied from interface:XSObject
The name of typeNCName
, as defined in XML Namespaces, of this declaration specified in the{name}
property of the component ornull
if the definition of this component does not have a{name}
property. For anonymous types, the processor must construct and expose an anonymous type name that is distinct from the name of every named type and the name of every other anonymous type.
-
getTypeName
public String getTypeName()
- Specified by:
getTypeName
in interfaceTypeInfo
-
getNamespace
public String getNamespace()
Description copied from interface:XSObject
The [target namespace] of this object, ornull
if it is unspecified.- Specified by:
getNamespace
in interfaceXSObject
-
getFinal
public short getFinal()
Description copied from interface:XSTypeDefinition
For complex types the returned value is a bit combination of the subset of {DERIVATION_EXTENSION, DERIVATION_RESTRICTION
} corresponding tofinal
set of this type orDERIVATION_NONE
. For simple types the returned value is a bit combination of the subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
} corresponding tofinal
set of this type orDERIVATION_NONE
.- Specified by:
getFinal
in interfaceXSTypeDefinition
-
isFinal
public boolean isFinal(short derivation)
Description copied from interface:XSTypeDefinition
{final}. For a complex type definition it is a subset of {extension, restriction}. For a simple type definition it is a subset of {extension, list, restriction, union}.- Specified by:
isFinal
in interfaceXSTypeDefinition
- Parameters:
derivation
- Extension, restriction, list, union constants (defined inXSConstants
).- Returns:
- True if
restriction
is in the final set, otherwise false.
-
getBaseType
public XSTypeDefinition getBaseType()
Description copied from interface:XSTypeDefinition
{base type definition}: either a simple type definition or a complex type definition.- Specified by:
getBaseType
in interfaceXSTypeDefinition
-
getAnonymous
public boolean getAnonymous()
Description copied from interface:XSTypeDefinition
Convenience attribute. A boolean that specifies if the type definition is anonymous.- Specified by:
getAnonymous
in interfaceXSTypeDefinition
-
getVariety
public short getVariety()
Description copied from interface:XSSimpleTypeDefinition
[variety]: one of {atomic, list, union} or absent.- Specified by:
getVariety
in interfaceXSSimpleTypeDefinition
-
isIDType
public boolean isIDType()
Description copied from interface:XSSimpleType
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.- Specified by:
isIDType
in interfaceXSSimpleType
- Returns:
- whether this simple type is or is derived from ID.
-
getWhitespace
public short getWhitespace() throws DatatypeException
Description copied from interface:XSSimpleType
Return the whitespace corresponding to this datatype.- Specified by:
getWhitespace
in interfaceXSSimpleType
- Returns:
- valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.
- Throws:
DatatypeException
- union datatypes don't have whitespace facet associated with them
-
getPrimitiveKind
public short getPrimitiveKind()
Description copied from interface:XSSimpleType
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.- Specified by:
getPrimitiveKind
in interfaceXSSimpleType
- Returns:
- an ID representing the built-in primitive base type
-
getBuiltInKind
public short getBuiltInKind()
Returns the closest built-in type category this type represents or derived from. For example, if this simple type is a built-in derived type integer theINTEGER_DV
is returned.- Specified by:
getBuiltInKind
in interfaceXSSimpleTypeDefinition
-
getPrimitiveType
public XSSimpleTypeDefinition getPrimitiveType()
If variety isatomic
the primitive type definition (a built-in primitive datatype definition or the simple ur-type definition) is available, otherwisenull
.- Specified by:
getPrimitiveType
in interfaceXSSimpleTypeDefinition
-
getItemType
public XSSimpleTypeDefinition getItemType()
If variety islist
the item type definition (an atomic or union simple type definition) is available, otherwisenull
.- Specified by:
getItemType
in interfaceXSSimpleTypeDefinition
-
getMemberTypes
public XSObjectList getMemberTypes()
If variety isunion
the list of member type definitions (a non-empty sequence of simple type definitions) is available, otherwise an emptyXSObjectList
.- Specified by:
getMemberTypes
in interfaceXSSimpleTypeDefinition
-
applyFacets
public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context) throws InvalidDatatypeFacetException
Ifis chosen - Specified by:
applyFacets
in interfaceXSSimpleType
- Parameters:
facets
- the value of all the facetspresentFacet
- 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.
-
validate
public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate a value, and return the compiled form- Specified by:
validate
in interfaceXSSimpleType
- Parameters:
content
- the string value that needs to be validatedcontext
- the validation contextvalidatedInfo
- used to store validation result- Returns:
- the actual value (QName, Boolean) of the string value
- Throws:
InvalidDatatypeValueException
-
getActualEnumValue
protected ValidatedInfo getActualEnumValue(String lexical, ValidationContext ctx, ValidatedInfo info) throws InvalidDatatypeValueException
- Throws:
InvalidDatatypeValueException
-
validateWithInfo
public ValidatedInfo validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate a value, and return the compiled form- Throws:
InvalidDatatypeValueException
-
validate
public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate a value, and return the compiled form- Specified by:
validate
in interfaceXSSimpleType
- Parameters:
content
- the string value that needs to be validatedcontext
- the validation contextvalidatedInfo
- used to store validation result- Returns:
- the actual value (QName, Boolean) of the string value
- Throws:
InvalidDatatypeValueException
-
validate
public void validate(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate an actual value against this DV- Specified by:
validate
in interfaceXSSimpleType
- Parameters:
context
- the validation contextvalidatedInfo
- used to provide the actual value and member types- Throws:
InvalidDatatypeValueException
- exception for invalid values.
-
isEqual
public boolean isEqual(Object value1, Object value2)
Description copied from interface:XSSimpleType
Check whether two actual values are equal.- Specified by:
isEqual
in interfaceXSSimpleType
- Parameters:
value1
- the first valuevalue2
- the second value- Returns:
- true if the two value are equal
-
getOrdered
public short getOrdered()
Fundamental Facet: ordered.- Specified by:
getOrdered
in interfaceXSSimpleTypeDefinition
-
getBounded
public boolean getBounded()
Fundamental Facet: bounded.- Specified by:
getBounded
in interfaceXSSimpleTypeDefinition
-
getFinite
public boolean getFinite()
Fundamental Facet: cardinality.- Specified by:
getFinite
in interfaceXSSimpleTypeDefinition
-
getNumeric
public boolean getNumeric()
Fundamental Facet: numeric.- Specified by:
getNumeric
in interfaceXSSimpleTypeDefinition
-
isDefinedFacet
public boolean isDefinedFacet(short facetName)
Convenience method. [Facets]: check whether a facet is defined on this type.- Specified by:
isDefinedFacet
in interfaceXSSimpleTypeDefinition
- Parameters:
facetName
- The name of the facet.- Returns:
- True if the facet is defined, false otherwise.
-
getDefinedFacets
public short getDefinedFacets()
[facets]: all facets defined on this type. The value is a bit combination of FACET_XXX constants of all defined facets.- Specified by:
getDefinedFacets
in interfaceXSSimpleTypeDefinition
-
isFixedFacet
public boolean isFixedFacet(short facetName)
Convenience method. [Facets]: check whether a facet is defined and fixed on this type.- Specified by:
isFixedFacet
in interfaceXSSimpleTypeDefinition
- Parameters:
facetName
- The name of the facet.- Returns:
- True if the facet is fixed, false otherwise.
-
getFixedFacets
public short getFixedFacets()
[facets]: all defined facets for this type which are fixed.- Specified by:
getFixedFacets
in interfaceXSSimpleTypeDefinition
-
getLexicalFacetValue
public String getLexicalFacetValue(short facetName)
Convenience method. Returns a value of a single constraining facet for this simple type definition. This method must not be used to retrieve values forenumeration
andpattern
facets.- Specified by:
getLexicalFacetValue
in interfaceXSSimpleTypeDefinition
- Parameters:
facetName
- The name of the facet, i.e.FACET_LENGTH, FACET_TOTALDIGITS
(seeXSConstants
). To retrieve the value for a pattern or an enumeration, seeenumeration
andpattern
.- Returns:
- A value of the facet specified in
facetName
for this simple type definition ornull
.
-
getLexicalEnumeration
public StringList getLexicalEnumeration()
A list of enumeration values if it exists, otherwise an emptyStringList
.- Specified by:
getLexicalEnumeration
in interfaceXSSimpleTypeDefinition
-
getActualEnumeration
public ObjectList getActualEnumeration()
A list of actual enumeration values if it exists, otherwise an emptyObjectList
.
-
getEnumerationItemTypeList
public ObjectList getEnumerationItemTypeList()
A list of enumeration type values (as a list of ShortList objects) if it exists, otherwise returns null
-
getEnumerationTypeList
public ShortList getEnumerationTypeList()
-
getLexicalPattern
public StringList getLexicalPattern()
A list of pattern values if it exists, otherwise an emptyStringList
.- Specified by:
getLexicalPattern
in interfaceXSSimpleTypeDefinition
-
getAnnotations
public XSObjectList getAnnotations()
[annotations]: a set of annotations for this simple type component if it exists, otherwise an emptyXSObjectList
.- Specified by:
getAnnotations
in interfaceXSSimpleTypeDefinition
-
derivedFromType
public boolean derivedFromType(XSTypeDefinition ancestor, short derivation)
Description copied from interface:XSTypeDefinition
Convenience method which checks if this type is derived from the givenancestorType
.- Specified by:
derivedFromType
in interfaceXSTypeDefinition
- Parameters:
ancestor
- An ancestor type definition.derivation
- A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
}.- Returns:
- True if this type is derived from
ancestorType
using only derivation methods from thederivationMethod
.
-
derivedFrom
public boolean derivedFrom(String ancestorNS, String ancestorName, short derivation)
Description copied from interface:XSTypeDefinition
Convenience method which checks if this type is derived from the given ancestor type.- Specified by:
derivedFrom
in interfaceXSTypeDefinition
- Parameters:
ancestorNS
- An ancestor type namespace.ancestorName
- An ancestor type name.derivation
- A bit combination representing a subset of {DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
}.- Returns:
- True if this type is derived from
ancestorType
using only derivation methods from thederivationMethod
.
-
isDOMDerivedFrom
public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
Checks if a type is derived from another by restriction, given the name and namespace. See: http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#TypeInfo-isDerivedFrom- Parameters:
ancestorNS
- The namspace of the ancestor type declarationancestorName
- The name of the ancestor type declarationderivationMethod
- The derivation method- Returns:
- boolean True if the ancestor type is derived from the reference type by the specifiied derivation method.
-
reset
public void reset()
-
getNamespaceItem
public XSNamespaceItem getNamespaceItem()
Description copied from interface:XSObject
A namespace schema information item corresponding to the target namespace of the component, if it is globally declared; ornull
otherwise.- Specified by:
getNamespaceItem
in interfaceXSObject
- See Also:
XSObject.getNamespaceItem()
-
setNamespaceItem
public void setNamespaceItem(XSNamespaceItem namespaceItem)
-
toString
public String toString()
- Overrides:
toString
in classObject
- See Also:
Object.toString()
-
getFacets
public XSObjectList getFacets()
A list of constraining facets if it exists, otherwise an emptyXSObjectList
. Note: This method must not be used to retrieve values forenumeration
andpattern
facets.- Specified by:
getFacets
in interfaceXSSimpleTypeDefinition
-
getFacet
public XSObject getFacet(int facetType)
Description copied from interface:XSSimpleTypeDefinition
A constraining facet object. An instance of XSFacet or XSMultiValueFacet.- Specified by:
getFacet
in interfaceXSSimpleTypeDefinition
-
getMultiValueFacets
public XSObjectList getMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists, otherwise an emptyXSObjectList
.- Specified by:
getMultiValueFacets
in interfaceXSSimpleTypeDefinition
-
getMinInclusiveValue
public Object getMinInclusiveValue()
-
getMinExclusiveValue
public Object getMinExclusiveValue()
-
getMaxInclusiveValue
public Object getMaxInclusiveValue()
-
getMaxExclusiveValue
public Object getMaxExclusiveValue()
-
setAnonymous
public void setAnonymous(boolean anon)
-
getTypeNamespace
public String getTypeNamespace()
- Specified by:
getTypeNamespace
in interfaceTypeInfo
-
isDerivedFrom
public boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
- Specified by:
isDerivedFrom
in interfaceTypeInfo
-
-