APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.impl.xs.models

public Class XSEmptyCM

extends Object
implements XSCMValidator
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator
Imports
com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler, .XMLSchemaException, com.sun.org.apache.xerces.internal.xni.QName, java.util.ArrayList, .List

XSEmptyCM is a derivative of the abstract content model base class that handles a content model with no chilren (elements). This model validated on the way in.
Authors
Elena Litani, Lisa Martin, IBM

Field Summary

Modifier and TypeField and Description
private static final List<Object>
private static final short

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<String>
checkMinMaxBounds()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.checkMinMaxBounds.

Used by constant space algorithm for a{n,m} for n > 1 and m <= unbounded.

public boolean

Returns:

true if this content model contains other or list wildcard
checkUniqueParticleAttribution
(SubstitutionGroupHandler
the substitution group handler
subGroupHandler
)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.checkUniqueParticleAttribution.

check whether this content violates UPA constraint.

public boolean

Returns:

true if the last state was a valid final state
endContentModel
(int[]
Current state of the content model
currentState
)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.endContentModel.

The method indicates the end of list of children

public String
getTermName(int termId)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.getTermName.

Returns the name of the term (element or wildcard) for the given identifier.

public boolean
isCompactedForUPA()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.isCompactedForUPA.

Checks if this content model has had its min/maxOccurs values reduced for purposes of speeding up UPA.

public int[]
occurenceInfo(int[] state)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.occurenceInfo.

Returns an array containing information about the current repeating term or null if no occurrence counting was being performed at the current state.

public Object

Returns:

element index corresponding to the element from the Schema grammar
oneTransition
(QName
the qualified name of the element
elementName
,
int[]
Current state
currentState
,
SubstitutionGroupHandler
the substitution group handler
subGroupHandler
)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.oneTransition.

The method corresponds to one transaction in the content model.

public int[]

Returns:

Start state of the content model
startContentModel
()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.startContentModel.

This methods to be called on entering a first element whose type has this content model.

public List<Object>

Returns:

a list whose entries are instances of either XSWildcardDecl or XSElementDecl.
whatCanGoHere
(int[]
the current state
state
)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.whatCanGoHere.

Check which elements are valid to appear at this point.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTYback to summary
private static final List<Object> EMPTY
STATE_STARTback to summary
private static final short STATE_START

Constructor Detail

XSEmptyCMback to summary
public XSEmptyCM()

Method Detail

checkMinMaxBoundsback to summary
public List<String> checkMinMaxBounds()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.checkMinMaxBounds.

Doc from com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.checkMinMaxBounds.

Used by constant space algorithm for a{n,m} for n > 1 and m <= unbounded. Called by a validator if validation of countent model succeeds after subsuming a{n,m} to a* (or a+) to check the n and m bounds.

checkUniqueParticleAttributionback to summary
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.checkUniqueParticleAttribution.

check whether this content violates UPA constraint.

Parameters
subGroupHandler:SubstitutionGroupHandler

the substitution group handler

Returns:boolean

true if this content model contains other or list wildcard

endContentModelback to summary
public boolean endContentModel(int[] currentState)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.endContentModel.

The method indicates the end of list of children

Parameters
currentState:int[]

Current state of the content model

Returns:boolean

true if the last state was a valid final state

getTermNameback to summary
public String getTermName(int termId)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.getTermName.

Doc from com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.getTermName.

Returns the name of the term (element or wildcard) for the given identifier.

isCompactedForUPAback to summary
public boolean isCompactedForUPA()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.isCompactedForUPA.

Doc from com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.isCompactedForUPA.

Checks if this content model has had its min/maxOccurs values reduced for purposes of speeding up UPA. If so, this content model should not be used for any purpose other than checking unique particle attribution

occurenceInfoback to summary
public int[] occurenceInfo(int[] state)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.occurenceInfo.

Doc from com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.occurenceInfo.

Returns an array containing information about the current repeating term or null if no occurrence counting was being performed at the current state.

If an array is returned it will have a length == 4 and will contain:

  • a[0] :: min occurs
  • a[1] :: max occurs
  • a[2] :: current value of the counter
  • a[3] :: identifier for the repeating term

oneTransitionback to summary
public Object oneTransition(QName elementName, int[] currentState, SubstitutionGroupHandler subGroupHandler)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.oneTransition.

The method corresponds to one transaction in the content model.

Parameters
elementName:QName

the qualified name of the element

currentState:int[]

Current state

subGroupHandler:SubstitutionGroupHandler

the substitution group handler

Returns:Object

element index corresponding to the element from the Schema grammar

startContentModelback to summary
public int[] startContentModel()

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.startContentModel.

This methods to be called on entering a first element whose type has this content model. It will return the initial state of the content model

Returns:int[]

Start state of the content model

whatCanGoHereback to summary
public List<Object> whatCanGoHere(int[] state)

Implements com.sun.org.apache.xerces.internal.impl.xs.models.XSCMValidator.whatCanGoHere.

Check which elements are valid to appear at this point. This method also works if the state is in error, in which case it returns what should have been seen.

Parameters
state:int[]

the current state

Returns:List<Object>

a list whose entries are instances of either XSWildcardDecl or XSElementDecl.