public class XSSimpleTypeDecl extends Object implements XSSimpleType, TypeInfo
| Modifier and Type | Field and 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 |
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_REPLACEFACET_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_UNIONCOMPLEX_TYPE, SIMPLE_TYPE| Modifier | Constructor and 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) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyFacets(XSFacets facets,
short presentFacet,
short fixedFacet,
ValidationContext context)
If
|
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 given
ancestorType. |
ObjectList |
getActualEnumeration()
A list of actual enumeration values if it exists, otherwise an empty
ObjectList. |
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 empty
XSObjectList. |
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
null
|
ShortList |
getEnumerationTypeList() |
XSObject |
getFacet(int facetType)
A constraining facet object.
|
XSObjectList |
getFacets()
A list of constraining facets if it exists, otherwise an empty
XSObjectList. |
short |
getFinal()
For complex types the returned value is a bit combination of the subset
of {
DERIVATION_EXTENSION, DERIVATION_RESTRICTION}
corresponding to final set of this type or
DERIVATION_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 is
list the item type definition (an atomic or
union simple type definition) is available, otherwise
null. |
StringList |
getLexicalEnumeration()
A list of enumeration values if it exists, otherwise an empty
StringList. |
String |
getLexicalFacetValue(short facetName)
Convenience method.
|
StringList |
getLexicalPattern()
A list of pattern values if it exists, otherwise an empty
StringList. |
Object |
getMaxExclusiveValue() |
Object |
getMaxInclusiveValue() |
XSObjectList |
getMemberTypes()
If variety is
union the list of member type definitions (a
non-empty sequence of simple type definitions) is available,
otherwise an empty XSObjectList. |
Object |
getMinExclusiveValue() |
Object |
getMinInclusiveValue() |
XSObjectList |
getMultiValueFacets()
A list of enumeration and pattern constraining facets if it exists,
otherwise an empty
XSObjectList. |
String |
getName()
The name of type
NCName, as defined in XML Namespaces, of
this declaration specified in the {name} property of the
component or null if the definition of this component
does not have a {name} property. |
String |
getNamespace()
The [target namespace] of this object, or
null if it is
unspecified. |
XSNamespaceItem |
getNamespaceItem()
A namespace schema information item corresponding to the target
namespace of the component, if it is globally declared; or
null 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 is
atomic the primitive type definition (a
built-in primitive datatype definition or the simple ur-type
definition) is available, otherwise null. |
short |
getType()
The
type 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 form
|
Object |
validate(String content,
ValidationContext context,
ValidatedInfo validatedInfo)
validate a value, and return the compiled form
|
void |
validate(ValidationContext context,
ValidatedInfo validatedInfo)
validate an actual value against this DV
|
ValidatedInfo |
validateWithInfo(String content,
ValidationContext context,
ValidatedInfo validatedInfo)
validate a value, and return the compiled form
|
protected static final short DV_STRING
protected static final short DV_BOOLEAN
protected static final short DV_DECIMAL
protected static final short DV_FLOAT
protected static final short DV_DOUBLE
protected static final short DV_DURATION
protected static final short DV_DATETIME
protected static final short DV_TIME
protected static final short DV_DATE
protected static final short DV_GYEARMONTH
protected static final short DV_GYEAR
protected static final short DV_GMONTHDAY
protected static final short DV_GDAY
protected static final short DV_GMONTH
protected static final short DV_HEXBINARY
protected static final short DV_BASE64BINARY
protected static final short DV_ANYURI
protected static final short DV_QNAME
protected static final short DV_PRECISIONDECIMAL
protected static final short DV_NOTATION
protected static final short DV_ANYSIMPLETYPE
protected static final short DV_ID
protected static final short DV_IDREF
protected static final short DV_ENTITY
protected static final short DV_INTEGER
protected static final short DV_LIST
protected static final short DV_UNION
protected static final short DV_YEARMONTHDURATION
protected static final short DV_DAYTIMEDURATION
protected static final short DV_ANYATOMICTYPE
public static final short YEARMONTHDURATION_DT
public static final short DAYTIMEDURATION_DT
public static final short PRECISIONDECIMAL_DT
public static final short ANYATOMICTYPE_DT
public XSAnnotation lengthAnnotation
public XSAnnotation minLengthAnnotation
public XSAnnotation maxLengthAnnotation
public XSAnnotation whiteSpaceAnnotation
public XSAnnotation totalDigitsAnnotation
public XSAnnotation fractionDigitsAnnotation
public XSObjectListImpl patternAnnotations
public XSObjectList enumerationAnnotations
public XSAnnotation maxInclusiveAnnotation
public XSAnnotation maxExclusiveAnnotation
public XSAnnotation minInclusiveAnnotation
public XSAnnotation minExclusiveAnnotation
public XSSimpleTypeDecl()
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, short builtInKind)
protected XSSimpleTypeDecl(XSSimpleTypeDecl base, String name, String uri, short finalSet, boolean isImmutable, XSObjectList annotations)
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, boolean isImmutable, XSObjectList annotations)
protected XSSimpleTypeDecl(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
protected static TypeValidator[] getGDVs()
protected void setDVs(TypeValidator[] dvs)
protected XSSimpleTypeDecl setRestrictionValues(XSSimpleTypeDecl base, String name, String uri, short finalSet, XSObjectList annotations)
protected XSSimpleTypeDecl setListValues(String name, String uri, short finalSet, XSSimpleTypeDecl itemType, XSObjectList annotations)
protected XSSimpleTypeDecl setUnionValues(String name, String uri, short finalSet, XSSimpleTypeDecl[] memberTypes, XSObjectList annotations)
public short getType()
XSObjecttype of this object, i.e.
ELEMENT_DECLARATION.public short getTypeCategory()
XSTypeDefinitiongetTypeCategory in interface XSTypeDefinitionpublic String getName()
XSObjectNCName, as defined in XML Namespaces, of
this declaration specified in the {name} property of the
component or null 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.public String getTypeName()
getTypeName in interface TypeInfopublic String getNamespace()
XSObjectnull if it is
unspecified.getNamespace in interface XSObjectpublic short getFinal()
XSTypeDefinitionDERIVATION_EXTENSION, DERIVATION_RESTRICTION}
corresponding to final set of this type or
DERIVATION_NONE. For simple types the returned value is
a bit combination of the subset of {
DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
} corresponding to final set of this type or
DERIVATION_NONE.getFinal in interface XSTypeDefinitionpublic boolean isFinal(short derivation)
XSTypeDefinitionisFinal in interface XSTypeDefinitionderivation - Extension, restriction, list, union constants
(defined in XSConstants).restriction is in the final set,
otherwise false.public XSTypeDefinition getBaseType()
XSTypeDefinitiongetBaseType in interface XSTypeDefinitionpublic boolean getAnonymous()
XSTypeDefinitiongetAnonymous in interface XSTypeDefinitionpublic short getVariety()
XSSimpleTypeDefinitiongetVariety in interface XSSimpleTypeDefinitionpublic boolean isIDType()
XSSimpleTypeisIDType in interface XSSimpleTypepublic short getWhitespace()
throws DatatypeException
XSSimpleTypegetWhitespace in interface XSSimpleTypeDatatypeException - union datatypes don't have whitespace facet associated with thempublic short getPrimitiveKind()
XSSimpleTypegetPrimitiveKind in interface XSSimpleTypepublic short getBuiltInKind()
INTEGER_DV is returned.getBuiltInKind in interface XSSimpleTypeDefinitionpublic XSSimpleTypeDefinition getPrimitiveType()
atomic the primitive type definition (a
built-in primitive datatype definition or the simple ur-type
definition) is available, otherwise null.getPrimitiveType in interface XSSimpleTypeDefinitionpublic XSSimpleTypeDefinition getItemType()
list the item type definition (an atomic or
union simple type definition) is available, otherwise
null.getItemType in interface XSSimpleTypeDefinitionpublic XSObjectList getMemberTypes()
union the list of member type definitions (a
non-empty sequence of simple type definitions) is available,
otherwise an empty XSObjectList.getMemberTypes in interface XSSimpleTypeDefinitionpublic void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context) throws InvalidDatatypeFacetException
applyFacets in interface XSSimpleTypefacets - 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 contextInvalidDatatypeFacetException - exception for invalid facet values.public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate in interface XSSimpleTypecontent - the string value that needs to be validatedcontext - the validation contextvalidatedInfo - used to store validation resultInvalidDatatypeValueExceptionprotected ValidatedInfo getActualEnumValue(String lexical, ValidationContext ctx, ValidatedInfo info) throws InvalidDatatypeValueException
InvalidDatatypeValueExceptionpublic ValidatedInfo validateWithInfo(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
InvalidDatatypeValueExceptionpublic Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate in interface XSSimpleTypecontent - the string value that needs to be validatedcontext - the validation contextvalidatedInfo - used to store validation resultInvalidDatatypeValueExceptionpublic void validate(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
validate in interface XSSimpleTypecontext - the validation contextvalidatedInfo - used to provide the actual value and member typesInvalidDatatypeValueException - exception for invalid values.public boolean isEqual(Object value1, Object value2)
XSSimpleTypeisEqual in interface XSSimpleTypevalue1 - the first valuevalue2 - the second valuepublic short getOrdered()
getOrdered in interface XSSimpleTypeDefinitionpublic boolean getBounded()
getBounded in interface XSSimpleTypeDefinitionpublic boolean getFinite()
getFinite in interface XSSimpleTypeDefinitionpublic boolean getNumeric()
getNumeric in interface XSSimpleTypeDefinitionpublic boolean isDefinedFacet(short facetName)
isDefinedFacet in interface XSSimpleTypeDefinitionfacetName - The name of the facet.public short getDefinedFacets()
getDefinedFacets in interface XSSimpleTypeDefinitionpublic boolean isFixedFacet(short facetName)
isFixedFacet in interface XSSimpleTypeDefinitionfacetName - The name of the facet.public short getFixedFacets()
getFixedFacets in interface XSSimpleTypeDefinitionpublic String getLexicalFacetValue(short facetName)
enumeration and pattern facets.getLexicalFacetValue in interface XSSimpleTypeDefinitionfacetName - The name of the facet, i.e.
FACET_LENGTH, FACET_TOTALDIGITS (see
XSConstants). To retrieve the value for a pattern or
an enumeration, see enumeration and
pattern.facetName for
this simple type definition or null.public StringList getLexicalEnumeration()
StringList.getLexicalEnumeration in interface XSSimpleTypeDefinitionpublic ObjectList getActualEnumeration()
ObjectList.public ObjectList getEnumerationItemTypeList()
public ShortList getEnumerationTypeList()
public StringList getLexicalPattern()
StringList.getLexicalPattern in interface XSSimpleTypeDefinitionpublic XSObjectList getAnnotations()
XSObjectList.getAnnotations in interface XSSimpleTypeDefinitionpublic boolean derivedFromType(XSTypeDefinition ancestor, short derivation)
XSTypeDefinitionancestorType.derivedFromType in interface XSTypeDefinitionancestor - An ancestor type definition.derivation - A bit combination representing a subset of {
DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST
}.ancestorType
using only derivation methods from the derivationMethod
.public boolean derivedFrom(String ancestorNS, String ancestorName, short derivation)
XSTypeDefinitionderivedFrom in interface XSTypeDefinitionancestorNS - 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
}.ancestorType
using only derivation methods from the derivationMethod
.public boolean isDOMDerivedFrom(String ancestorNS, String ancestorName, int derivationMethod)
ancestorNS - The namspace of the ancestor type declarationancestorName - The name of the ancestor type declarationderivationMethod - The derivation methodpublic void reset()
public XSNamespaceItem getNamespaceItem()
XSObjectnull otherwise.getNamespaceItem in interface XSObjectXSObject.getNamespaceItem()public void setNamespaceItem(XSNamespaceItem namespaceItem)
public String toString()
toString in class ObjectObject.toString()public XSObjectList getFacets()
XSObjectList. Note: This method must not be used to
retrieve values for enumeration and pattern
facets.getFacets in interface XSSimpleTypeDefinitionpublic XSObject getFacet(int facetType)
XSSimpleTypeDefinitiongetFacet in interface XSSimpleTypeDefinitionpublic XSObjectList getMultiValueFacets()
XSObjectList.getMultiValueFacets in interface XSSimpleTypeDefinitionpublic Object getMinInclusiveValue()
public Object getMinExclusiveValue()
public Object getMaxInclusiveValue()
public Object getMaxExclusiveValue()
public void setAnonymous(boolean anon)
public String getTypeNamespace()
getTypeNamespace in interface TypeInfopublic boolean isDerivedFrom(String typeNamespaceArg, String typeNameArg, int derivationMethod)
isDerivedFrom in interface TypeInfoCopyright © 2018 JBoss by Red Hat. All rights reserved.