|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.saxonica.schema.SchemaStructure com.saxonica.schema.Wildcard
public class Wildcard
A class that represents an XML Schema Wildcard. This is a helper class used to support the two distinct but similar schema components ElementWildcard and AttributeWildcard. A wilcard is represented by the XML elements xs:any and xs:anyAttribute
Field Summary |
---|
Fields inherited from interface net.sf.saxon.type.SchemaComponent |
---|
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING |
Constructor Summary | |
---|---|
Wildcard()
|
Method Summary | |
---|---|
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 |
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(int fingerprint,
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 |
overlaps(Wildcard other)
Determine whether this wildcard overlaps another wildcard, that is, whether there is an element that could match either. |
String |
reasonForNonMatch(int fingerprint,
boolean isElement,
Configuration config)
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) |
Methods inherited from class com.saxonica.schema.SchemaStructure |
---|
elaborate, fixup, getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getRedefinitionLevel, getSchemaDocumentURI, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setRedefinitionLevel, setSchemaDocumentURI, setSystemId, setValidationStatus |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.saxonica.schema.UserSchemaComponent |
---|
elaborate, fixup, lookForCycles |
Methods inherited from interface net.sf.saxon.type.SchemaComponent |
---|
getRedefinitionLevel, getValidationStatus |
Constructor Detail |
---|
public Wildcard()
Method Detail |
---|
public boolean isInexpressible()
public final boolean allowsAny()
public void setNoNamespacesAllowed()
public void addAllowedNamespace(String namespace)
namespace
- the namespace to addpublic void addDisallowedNamespace(String namespace)
public Set<String> getDisallowedNamespaces()
public boolean matches(String uri)
uri
- the namespace to be tested. Supply "" for the null (or "absent") namespace.
public boolean matches(int fingerprint, boolean isElement, Configuration config, UserComplexType parentType)
fingerprint
- the fingerprint of the nameisElement
- 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(int fingerprint, boolean isElement, Configuration config)
fingerprint
- the fingerprint of the nameisElement
- true if looking for an element, false if looking for an attributeconfig
- the Saxon configuration
public boolean disallowsQName(int fingerprint)
fingerprint
- the fingerprint of the name to be tested
public 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 question
public boolean validate(SchemaCompiler compiler) throws SchemaException
validate
in interface UserSchemaComponent
SchemaException
public String toString()
toString
in class Object
public boolean isSubset(Wildcard sup, NamePool pool)
sup
- the other wildcardpool
- the NamePoolpublic boolean overlaps(Wildcard other)
public static boolean isNotStronger(String str1, String str2)
str1
- the first processContents value, as a stringstr2
- the second processContents value, as a string
public 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 NamePool
public 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 Pool
public void serialize(SchemaModelSerializer serializer) throws XPathException
serialize
in interface SerializableSchemaComponent
XPathException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |