com.saxonica.schema
Class Wildcard

java.lang.Object
  extended bycom.saxonica.schema.SchemaStructure
      extended bycom.saxonica.schema.Wildcard
All Implemented Interfaces:
java.io.Serializable, javax.xml.transform.SourceLocator
Direct Known Subclasses:
AttributeWildcard, ElementWildcard

public abstract class Wildcard
extends SchemaStructure

A class that represents an XML Schema Wildcard. A wilcard is represented by the XML elements and and can be hold in a complexType or in a Group ().

See Also:
Serialized Form

Constructor Summary
Wildcard()
           
 
Method Summary
 void addNamespace(java.lang.String namespace)
          Add a permitted namespace.
 boolean allowsAny()
          Determine whether this wildcard allows any namespace (##any)
 java.util.Iterator getAllowedNamespaces()
          Returns an enumeration that contains the permitted namespaces of this wildcard
 java.lang.String getDisallowedNamespace()
          Get the disallowed namespace.
 java.lang.String getProcessContents()
          Returns the processContents attribute of this wildcard
 boolean isIntensionalSubset(Wildcard sup)
          Determine whether this wildcard is an intensional subset of another wildcard.
 boolean matches(java.lang.String uri)
          Determine whether a particular namespace is allowed by this wildcard
 void setDisallowedNamespace(java.lang.String namespace)
          Set the disallowed namespace.
 void setNoNamespacesAllowed()
          Initialize the set of permitted namespaces to an empty list.
 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(PreparedSchema schema)
          Perform validation on this wildcard (this implementation of the method is a no-op)
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getFixupStatus, getLineNumber, getPublicId, getSchema, getSystemId, getValidationStatus, lookForCycles, setFixupStatus, setLineNumber, setLocator, setSchema, setSystemId, setValidationStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Wildcard

public Wildcard()
Method Detail

allowsAny

public final boolean allowsAny()
Determine whether this wildcard allows any namespace (##any)


setNoNamespacesAllowed

public void setNoNamespacesAllowed()
Initialize the set of permitted namespaces to an empty list. This is needed in case the namespace attribute is present but empty; it indicates that no namespaces are allowed.


addNamespace

public void addNamespace(java.lang.String namespace)
Add a permitted namespace. This must be an actual namespace, not one of the special tokens such as ##other. Validation of the namespace is the responsibility of the caller.

Parameters:
namespace - the namespace to add

setDisallowedNamespace

public void setDisallowedNamespace(java.lang.String namespace)
Set the disallowed namespace. This corresponds to the option ##other.


getDisallowedNamespace

public java.lang.String getDisallowedNamespace()
Get the disallowed namespace. Returns null if there is no disallowed namespace.


matches

public boolean matches(java.lang.String uri)
Determine whether a particular namespace is allowed by this wildcard

Parameters:
uri - the namespace to be tested. Supply "" for the null namespace.
Returns:
true if the wildcard allows this namespace, false if not.

getAllowedNamespaces

public java.util.Iterator getAllowedNamespaces()
Returns an enumeration that contains the permitted namespaces of this wildcard

Returns:
an enumeration that contains the permitted namespaces of this wildcard, or null if the wildcard uses the ##any or ##other options

getProcessContents

public java.lang.String getProcessContents()
Returns the processContents attribute of this wildcard

Returns:
the processContents attribute of this wildcard, as a string ("strict", "lax", or "skip")

setProcessContents

public void setProcessContents(java.lang.String process)
Sets the processContents attribute of the wildCard. For internal use only.

Parameters:
process - the processContents value to set (e.g. "strict", "lax"). Validation of the value is the responsibility of the caller.

validate

public boolean validate(PreparedSchema schema)
                 throws SchemaException
Perform validation on this wildcard (this implementation of the method is a no-op)

Throws:
SchemaException

toString

public java.lang.String toString()
Get a string representation of this wildcard, used for diagnostics


isIntensionalSubset

public boolean isIntensionalSubset(Wildcard sup)
Determine whether this wildcard is an intensional subset of another wildcard. See Schema Part 1 Schema Component Constraint: Wildcard Subset (section 3.10.6)