com.saxonica.schema
Class ElementWildcard

java.lang.Object
  extended bycom.saxonica.schema.SchemaStructure
      extended bycom.saxonica.schema.Wildcard
          extended bycom.saxonica.schema.ElementWildcard
All Implemented Interfaces:
Particle, SchemaComponent, java.io.Serializable, javax.xml.transform.SourceLocator, Term, UserSchemaComponent

public class ElementWildcard
extends Wildcard
implements UserSchemaComponent, Particle, Term

This class represents an element in the schema.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface net.sf.saxon.type.SchemaComponent
FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING
 
Constructor Summary
ElementWildcard()
           
 
Method Summary
 void compile(PreparedSchema schema, UserComplexType subjectType)
          Compile a particle
 boolean fixup(PreparedSchema schema)
          Check references from this component to other components
 int getElementParticleCardinality(int fingerprint)
          Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the cardinality associated with that element particle, that is, the number of times the element can occur within this complex type.
 SchemaType getElementParticleType(int fingerprint)
          Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the schema type associated with that element particle.
 int getMaxOccurs()
          Get the maxOccurs attribute
 int getMinOccurs()
          Get the minOccurs attribute
 Term getTerm()
          Get the term represented by this particle
 boolean isEmptiable()
          Determine if this particle can be empty
 void rewrite()
          Rewrite a particle prior to compiling it
 void setMaxOccurs(int maxOccurs)
          Set the maxOccurs attribute
 void setMinOccurs(int minOccurs)
          Set the minOccurs attribute.
 
Methods inherited from class com.saxonica.schema.Wildcard
addNamespace, allowsAny, getAllowedNamespaces, getDisallowedNamespace, getProcessContents, isIntensionalSubset, matches, setDisallowedNamespace, setNoNamespacesAllowed, setProcessContents, toString, validate
 
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
 
Methods inherited from interface com.saxonica.schema.UserSchemaComponent
lookForCycles, validate
 
Methods inherited from interface net.sf.saxon.type.SchemaComponent
getValidationStatus
 

Constructor Detail

ElementWildcard

public ElementWildcard()
Method Detail

getMinOccurs

public int getMinOccurs()
Get the minOccurs attribute

Specified by:
getMinOccurs in interface Particle
Returns:
the minOccurs attribute (default 1)

setMinOccurs

public void setMinOccurs(int minOccurs)
Set the minOccurs attribute.

Specified by:
setMinOccurs in interface Particle
Parameters:
minOccurs - the value of the minOccurs attribute

getMaxOccurs

public int getMaxOccurs()
Get the maxOccurs attribute

Specified by:
getMaxOccurs in interface Particle
Returns:
the value of the attribute (unbounded = -1)

setMaxOccurs

public void setMaxOccurs(int maxOccurs)
Set the maxOccurs attribute

Parameters:
maxOccurs - the value of the attribute (unbounded = -1)

isEmptiable

public boolean isEmptiable()
Determine if this particle can be empty

Specified by:
isEmptiable in interface Particle

getTerm

public Term getTerm()
Get the term represented by this particle

Specified by:
getTerm in interface Particle

fixup

public boolean fixup(PreparedSchema schema)
              throws SchemaException
Check references from this component to other components

Specified by:
fixup in interface UserSchemaComponent
Parameters:
schema - The schema is used for reporting errors
Returns:
true if all is well, false if errors found
Throws:
SchemaException

rewrite

public void rewrite()
Rewrite a particle prior to compiling it

Specified by:
rewrite in interface Particle

compile

public void compile(PreparedSchema schema,
                    UserComplexType subjectType)
             throws SchemaException
Description copied from interface: Particle
Compile a particle

Specified by:
compile in interface Particle
Parameters:
schema - used for error reporting purposes
subjectType - the complex type being compiled
Throws:
SchemaException

getElementParticleType

public SchemaType getElementParticleType(int fingerprint)
Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the schema type associated with that element particle. If there is no such particle, return null. If the fingerprint matches an element wildcard, return the type of the global element declaration with the given name if one exists, or AnyType if none exists and lax validation is permitted by the wildcard.

Specified by:
getElementParticleType in interface Particle
Parameters:
fingerprint - Identifies the name of the child element within this content model

getElementParticleCardinality

public int getElementParticleCardinality(int fingerprint)
                                  throws SchemaException,
                                         ValidationException
Find an element particle within this complex type definition having a given element name (identified by fingerprint), and return the cardinality associated with that element particle, that is, the number of times the element can occur within this complex type. The value is one of StaticProperty.EXACTLY_ONE, StaticProperty.ALLOWS_ZERO_OR_ONE, StaticProperty.ALLOWS_ZERO_OR_MORE, StaticProperty.ALLOWS_ONE_OR_MORE, If there is no such particle, return zero.

Specified by:
getElementParticleCardinality in interface Particle
Parameters:
fingerprint - Identifies the name of the child element within this content model
Throws:
SchemaException
ValidationException