com.saxonica.schema
Class ElementWildcard

java.lang.Object
  extended by com.saxonica.schema.SchemaStructure
      extended by com.saxonica.schema.Wildcard
          extended by com.saxonica.schema.ElementWildcard
All Implemented Interfaces:
Particle, SerializableSchemaComponent, Term, UserSchemaComponent, Serializable, SourceLocator, SchemaComponent

public class ElementWildcard
extends Wildcard
implements UserSchemaComponent, Particle, Term

This class represents an element in the schema.

See Also:
Serialized Form

Constructor Summary
ElementWildcard()
           
 
Method Summary
 void compile(SchemaCompiler compiler)
          Compile a particle
 boolean fixup(SchemaCompiler compiler)
          Check references from this component to other components
 void gatherAllPermittedElements(IntHashSet result)
          Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints.
 int getComponentTypeCode()
          Get a unique number identifying the type of component
 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
 boolean isPointless(Particle container)
          Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)
 void serialize(SchemaSerializer serializer)
          Serialize the schema component
 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, isNotStronger, matches, overlaps, setDisallowedNamespace, setNoNamespacesAllowed, setProcessContents, toString, validate
 
Methods inherited from class com.saxonica.schema.SchemaStructure
getColumnNumber, getConfiguration, getFixupStatus, getLineNumber, getPublicId, getSystemId, getValidationStatus, lookForCycles, setConfiguration, setFixupStatus, setLineNumber, setLocator, setSystemId, setValidationStatus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

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

isPointless

public boolean isPointless(Particle container)
Test whether the particle is pointless, as described in XML Schema Part 1 Schema Component Constraint: Particle Valid (Restriction)

Specified by:
isPointless in interface Particle

getTerm

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

Specified by:
getTerm in interface Particle

fixup

public boolean fixup(SchemaCompiler compiler)
              throws SchemaException
Check references from this component to other components

Specified by:
fixup in interface UserSchemaComponent
Parameters:
compiler -
Returns:
true if all is well, false if errors found
Throws:
SchemaException

compile

public void compile(SchemaCompiler compiler)
             throws SchemaException
Description copied from interface: Particle
Compile a particle

Specified by:
compile in interface Particle
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

gatherAllPermittedElements

public void gatherAllPermittedElements(IntHashSet result)
                                throws SchemaException,
                                       ValidationException
Find the set of all element particles allowed within the content model of this particle, identified by their integer fingerprints. Ignore wildcards.

Specified by:
gatherAllPermittedElements in interface Particle
Parameters:
result - an initially-empty integer set in which the results are accumulated
Throws:
SchemaException
ValidationException

serialize

public void serialize(SchemaSerializer serializer)
               throws IOException
Serialize the schema component

Specified by:
serialize in interface SerializableSchemaComponent
Throws:
IOException

getComponentTypeCode

public int getComponentTypeCode()
Get a unique number identifying the type of component

Specified by:
getComponentTypeCode in interface SerializableSchemaComponent


Copyright (C) Michael H. Kay. All rights reserved.