public class Wildcard extends SchemaStructure implements UserSchemaComponent, SerializableSchemaComponent, Term
COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
Constructor and Description |
---|
Wildcard() |
Modifier and Type | Method and Description |
---|---|
void |
addAllowedNamespace(java.lang.String namespace)
Add a permitted namespace.
|
void |
addDisallowedNamespace(java.lang.String namespace)
Add a disallowed namespace.
|
void |
addDisallowedQName(int fingerprint)
Mark a specific QName as being disallowed
|
boolean |
allowsAny()
Determine whether this wildcard allows any namespace (##any)
|
int |
compareStrength(Wildcard other) |
boolean |
disallowsQName(int fingerprint)
Test whether a name is in the set of disallowed QNames
|
java.util.Set<java.lang.String> |
getAllowedNamespaces()
Returns the set of permitted namespaces of this wildcard
|
Function |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
java.util.Set<java.lang.String> |
getDisallowedNamespaces()
Get the disallowed namespaces.
|
java.lang.String |
getProcessContents()
Returns the processContents attribute of this wildcard
|
boolean |
isDisallowDefinedNames()
Ask whether globally-defined names are disallowed
|
boolean |
isDisallowDefinedSiblings()
Ask whether defined siblings are disallowed
|
boolean |
isDisallowedQName(int fingerprint)
Ask whether a specific QName is disallowed
|
boolean |
isInexpressible()
Determine whether this wildcard represents an "inexpressible" intersection or union
|
static boolean |
isNotStronger(java.lang.String str1,
java.lang.String str2)
Test whether one processContents value is <= the strength of another,
where skip < lax < strict
|
boolean |
isSubset(Wildcard sup,
NamePool pool)
Determine whether this wildcard is a subset of another wildcard.
|
static Wildcard |
makeIntersection(Wildcard wat1,
Wildcard wat2,
NamePool pool)
Create an AttributeWildcard as the intersection of two AttributeWildcards.
|
static Wildcard |
makeUnion(Wildcard wat1,
Wildcard wat2,
NamePool pool)
Create a AttributeWildcard as the union of two AttributeWildcards.
|
boolean |
matches(NodeName name,
boolean isElement,
Configuration config,
UserComplexType parentType)
Determine whether a name is allowed by this wildcard.
|
boolean |
matches(java.lang.String uri)
Determine whether a particular namespace is allowed by this wildcard.
|
boolean |
matches(StructuredQName name,
boolean isElement,
Configuration config,
UserComplexType parentType)
Determine whether a name is allowed by this wildcard.
|
boolean |
overlaps(Wildcard other)
Determine whether this wildcard overlaps another wildcard, that is, whether there is
an element that could match either.
|
java.lang.String |
reasonForNonMatch(NodeName nn,
boolean isElement,
Configuration config,
UserComplexType parentType)
If matches() returns false, return a string explaining the reason for the non-match
|
void |
serialize(SchemaModelSerializer serializer)
Serialize this schema component
|
void |
setDisallowDefinedNames(boolean disallow)
Say that defined names are not allowed (notQName = "##defined")
|
void |
setDisallowDefinedSiblings(boolean disallow)
Say that defined siblings are not allowed (notQName = "##definedSibling")
|
void |
setNoNamespacesAllowed()
Initialize the set of permitted namespaces to an empty set.
|
void |
setProcessContents(java.lang.String process)
Sets the processContents attribute of the wildCard.
|
java.lang.String |
toString()
Get a string representation of this wildcard, used for diagnostics
|
boolean |
validate(SchemaCompiler compiler)
Perform validation on this wildcard (this implementation of the method is a no-op)
|
elaborate, fixup, getColumnNumber, getConfiguration, getFixupStatus, getGeneratedId, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, hasSameLocation, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, setGeneratedId, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
elaborate, fixup, lookForCycles
getRedefinitionLevel, getValidationStatus
public boolean isInexpressible()
public final boolean allowsAny()
public void setNoNamespacesAllowed()
public void addAllowedNamespace(java.lang.String namespace)
namespace
- the namespace to addpublic void addDisallowedNamespace(java.lang.String namespace)
namespace
- the disallowed namespace to be addedpublic java.util.Set<java.lang.String> getDisallowedNamespaces()
public boolean matches(java.lang.String uri)
uri
- the namespace to be tested. Supply "" for the no-namespace.public boolean matches(StructuredQName name, boolean isElement, Configuration config, UserComplexType parentType)
name
- the name to be testedisElement
- true if looking for an element, false if looking for an attributeconfig
- the Saxon configurationparentType
- the governing type definition of the parent element, used to assess whether
the ##definedSibling constraint prevents an element from matching. May be null, in which case
##definedSibling is ignored.public boolean matches(NodeName name, boolean isElement, Configuration config, UserComplexType parentType)
name
- the name to be testedisElement
- true if looking for an element, false if looking for an attributeconfig
- the Saxon configurationparentType
- the governing type definition of the parent element, used to assess whether
the ##definedSibling constraint prevents an element from matching. May be null, in which case
##definedSibling is ignored.public java.lang.String reasonForNonMatch(NodeName nn, boolean isElement, Configuration config, UserComplexType parentType)
nn
- the name of the node that does not match the wildcardisElement
- true if looking for an element, false if looking for an attributeconfig
- the Saxon configurationparentType
- the governing type definition of the parent element, used to assess whether
the ##definedSibling constraint prevents an element from matching. May be null, in which case
##definedSibling is ignored.public boolean disallowsQName(int fingerprint)
fingerprint
- the fingerprint of the name to be testedpublic java.util.Set<java.lang.String> getAllowedNamespaces()
public java.lang.String getProcessContents()
public void setProcessContents(java.lang.String process)
process
- the processContents value to set (e.g. "strict", "lax").
Validation of the value is the responsibility of the caller.public void setDisallowDefinedNames(boolean disallow)
disallow
- true if defined names are disallowedpublic boolean isDisallowDefinedNames()
public void setDisallowDefinedSiblings(boolean disallow)
disallow
- true if defined siblings are disallowedpublic boolean isDisallowDefinedSiblings()
public void addDisallowedQName(int fingerprint)
fingerprint
- the NamePool fingerprint of the disallowed namepublic boolean isDisallowedQName(int fingerprint)
fingerprint
- the NamePool fingerprint of the QName in questionpublic boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
SchemaException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean isSubset(Wildcard sup, NamePool pool)
sup
- the other wildcardpool
- the NamePoolpublic boolean overlaps(Wildcard other)
other
- the other wildcardpublic static boolean isNotStronger(java.lang.String str1, java.lang.String str2)
str1
- the first processContents value, as a stringstr2
- the second processContents value, as a stringpublic int compareStrength(Wildcard other)
public static Wildcard makeIntersection(Wildcard wat1, Wildcard wat2, NamePool pool)
In XML Schema 1.1, the intersection of two wildcards is always expressible. The resulting wildcard might not be expressible using XML Schema 1.0, however.
wat1
- the first operand: the processContents is taken from this operandwat2
- the second operandpool
- the NamePoolpublic static Wildcard makeUnion(Wildcard wat1, Wildcard wat2, NamePool pool)
wat1
- the first operand: the processContents is taken from this operandwat2
- the second operandpool
- the Name Poolpublic void serialize(SchemaModelSerializer serializer) throws XPathException
serialize
in interface SerializableSchemaComponent
serializer
- the object responsible for performing the serializationMissingComponentException
- if the component cannot be serialized because it contains dangling referencesXPathException
- if serialization failspublic Function getComponentAsFunction()
SchemaComponent
getComponentAsFunction
in interface SchemaComponent
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.