public class XSSimpleTypeDelegate extends Object implements XSSimpleType
Modifier and Type | Field and Description |
---|---|
protected XSSimpleType |
type |
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
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
COMPLEX_TYPE, SIMPLE_TYPE
Constructor and Description |
---|
XSSimpleTypeDelegate(XSSimpleType type) |
Modifier and Type | Method and Description |
---|---|
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.
|
boolean |
derivedFrom(String namespace,
String name,
short derivationMethod)
Convenience method which checks if this type is derived from the given
ancestor type.
|
boolean |
derivedFromType(XSTypeDefinition ancestorType,
short derivationMethod)
Convenience method which checks if this type is derived from the given
ancestorType . |
XSObjectList |
getAnnotations()
A sequence of [annotations] or 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.
|
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.
|
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 . |
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 . |
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.
|
short |
getVariety()
[variety]: one of {atomic, list, union} or absent.
|
short |
getWhitespace()
Return the whitespace corresponding to this datatype.
|
XSSimpleType |
getWrappedXSSimpleType() |
boolean |
isDefinedFacet(short facetName)
Convenience method.
|
boolean |
isEqual(Object value1,
Object value2)
Check whether two actual values are equal.
|
boolean |
isFinal(short restriction)
{final}.
|
boolean |
isFixedFacet(short facetName)
Convenience method.
|
boolean |
isIDType()
Check whether this type is or is derived from ID.
|
String |
toString() |
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.
|
protected final XSSimpleType type
public XSSimpleTypeDelegate(XSSimpleType type)
public XSSimpleType getWrappedXSSimpleType()
public XSObjectList getAnnotations()
XSSimpleTypeDefinition
XSObjectList
.getAnnotations
in interface XSSimpleTypeDefinition
public boolean getBounded()
XSSimpleTypeDefinition
getBounded
in interface XSSimpleTypeDefinition
public short getBuiltInKind()
XSSimpleTypeDefinition
INTEGER_DV
is returned.getBuiltInKind
in interface XSSimpleTypeDefinition
public short getDefinedFacets()
XSSimpleTypeDefinition
getDefinedFacets
in interface XSSimpleTypeDefinition
public XSObjectList getFacets()
XSSimpleTypeDefinition
XSObjectList
. Note: This method must not be used to
retrieve values for enumeration
and pattern
facets.getFacets
in interface XSSimpleTypeDefinition
public XSObject getFacet(int facetType)
XSSimpleTypeDefinition
getFacet
in interface XSSimpleTypeDefinition
public boolean getFinite()
XSSimpleTypeDefinition
getFinite
in interface XSSimpleTypeDefinition
public short getFixedFacets()
XSSimpleTypeDefinition
getFixedFacets
in interface XSSimpleTypeDefinition
public XSSimpleTypeDefinition getItemType()
XSSimpleTypeDefinition
list
the item type definition (an atomic or
union simple type definition) is available, otherwise
null
.getItemType
in interface XSSimpleTypeDefinition
public StringList getLexicalEnumeration()
XSSimpleTypeDefinition
StringList
.getLexicalEnumeration
in interface XSSimpleTypeDefinition
public String getLexicalFacetValue(short facetName)
XSSimpleTypeDefinition
enumeration
and pattern
facets.getLexicalFacetValue
in interface XSSimpleTypeDefinition
facetName
- The name of the facet, i.e.
FACET_LENGTH, FACET_TOTALDIGITS
.
To retrieve the value for a pattern or
an enumeration, see enumeration
and
pattern
.facetName
for
this simple type definition or null
.public StringList getLexicalPattern()
XSSimpleTypeDefinition
StringList
.getLexicalPattern
in interface XSSimpleTypeDefinition
public XSObjectList getMemberTypes()
XSSimpleTypeDefinition
union
the list of member type definitions (a
non-empty sequence of simple type definitions) is available,
otherwise an empty XSObjectList
.getMemberTypes
in interface XSSimpleTypeDefinition
public XSObjectList getMultiValueFacets()
XSSimpleTypeDefinition
XSObjectList
.getMultiValueFacets
in interface XSSimpleTypeDefinition
public boolean getNumeric()
XSSimpleTypeDefinition
getNumeric
in interface XSSimpleTypeDefinition
public short getOrdered()
XSSimpleTypeDefinition
getOrdered
in interface XSSimpleTypeDefinition
public XSSimpleTypeDefinition getPrimitiveType()
XSSimpleTypeDefinition
atomic
the primitive type definition (a
built-in primitive datatype definition or the simple ur-type
definition) is available, otherwise null
.getPrimitiveType
in interface XSSimpleTypeDefinition
public short getVariety()
XSSimpleTypeDefinition
getVariety
in interface XSSimpleTypeDefinition
public boolean isDefinedFacet(short facetName)
XSSimpleTypeDefinition
isDefinedFacet
in interface XSSimpleTypeDefinition
facetName
- The name of the facet.public boolean isFixedFacet(short facetName)
XSSimpleTypeDefinition
isFixedFacet
in interface XSSimpleTypeDefinition
facetName
- The name of the facet.public boolean derivedFrom(String namespace, String name, short derivationMethod)
XSTypeDefinition
derivedFrom
in interface XSTypeDefinition
namespace
- An ancestor type namespace.name
- An ancestor type name.derivationMethod
- 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 derivedFromType(XSTypeDefinition ancestorType, short derivationMethod)
XSTypeDefinition
ancestorType
.derivedFromType
in interface XSTypeDefinition
ancestorType
- An ancestor type definition.derivationMethod
- 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 getAnonymous()
XSTypeDefinition
getAnonymous
in interface XSTypeDefinition
public XSTypeDefinition getBaseType()
XSTypeDefinition
getBaseType
in interface XSTypeDefinition
public short getFinal()
XSTypeDefinition
DERIVATION_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 XSTypeDefinition
public short getTypeCategory()
XSTypeDefinition
getTypeCategory
in interface XSTypeDefinition
public boolean isFinal(short restriction)
XSTypeDefinition
isFinal
in interface XSTypeDefinition
restriction
- Extension, restriction, list, union constants
(defined in XSConstants
).restriction
is in the final set,
otherwise false.public String getName()
XSObject
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. 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 getNamespace()
XSObject
null
if it is
unspecified.getNamespace
in interface XSObject
public XSNamespaceItem getNamespaceItem()
XSObject
null
otherwise.getNamespaceItem
in interface XSObject
public short getType()
XSObject
type
of this object, i.e.
ELEMENT_DECLARATION
.public void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context) throws InvalidDatatypeFacetException
XSSimpleType
XSFacets
is used to pass the value of
different facets.applyFacets
in interface XSSimpleType
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 contextInvalidDatatypeFacetException
- exception for invalid facet values.public short getPrimitiveKind()
XSSimpleType
getPrimitiveKind
in interface XSSimpleType
public short getWhitespace() throws DatatypeException
XSSimpleType
getWhitespace
in interface XSSimpleType
DatatypeException
- union datatypes don't have whitespace facet associated with thempublic boolean isEqual(Object value1, Object value2)
XSSimpleType
isEqual
in interface XSSimpleType
value1
- the first valuevalue2
- the second valuepublic boolean isIDType()
XSSimpleType
isIDType
in interface XSSimpleType
public void validate(ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
XSSimpleType
validate
in interface XSSimpleType
context
- the validation contextvalidatedInfo
- used to provide the actual value and member typesInvalidDatatypeValueException
- exception for invalid values.public Object validate(String content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
XSSimpleType
validate
in interface XSSimpleType
content
- the string value that needs to be validatedcontext
- the validation contextvalidatedInfo
- used to store validation resultInvalidDatatypeValueException
public Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
XSSimpleType
validate
in interface XSSimpleType
content
- the string value that needs to be validatedcontext
- the validation contextvalidatedInfo
- used to store validation resultInvalidDatatypeValueException
Copyright © 2019 JBoss by Red Hat. All rights reserved.