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(String namespace)
Add a permitted namespace.
|
void |
addDisallowedNamespace(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
|
Set<String> |
getAllowedNamespaces()
Returns the set of permitted namespaces of this wildcard
|
Function |
getComponentAsFunction()
Get the schema component in the form of a function item.
|
Set<String> |
getDisallowedNamespaces()
Get the disallowed namespaces.
|
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(String str1,
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(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.
|
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(String process)
Sets the processContents attribute of the wildCard.
|
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, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, makeXPathExpressionPropertyRecord, saveLocation, setConfiguration, setFixupStatus, 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(String namespace)
namespace
- the namespace to addpublic void addDisallowedNamespace(String namespace)
namespace
- the disallowed namespace to be addedpublic Set<String> getDisallowedNamespaces()
public boolean matches(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 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 Set<String> getAllowedNamespaces()
public String getProcessContents()
public void setProcessContents(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 String toString()
public boolean isSubset(Wildcard sup, NamePool pool)
sup
- the other wildcardpool
- the NamePoolpublic boolean overlaps(Wildcard other)
other
- the other wildcardpublic static boolean isNotStronger(String str1, 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-2014 Saxonica Limited. All rights reserved.