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

public Class XSAllCM

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, .XSConstraints, .XSElementDecl, com.sun.org.apache.xerces.internal.xni.QName, java.util.ArrayList, .List

XSAllCM implements XSCMValidator and handles <all>.
Author
Pavani Mukthipudi, Sun Microsystems Inc.

Field Summary

Modifier and TypeField and Description
private XSElementDecl[]
private boolean
private boolean[]
private int
private static final short
private static final short
private static final short

Constructor Summary

AccessConstructor and Description
public
XSAllCM(boolean hasOptionalContent, int size)

Method Summary

Modifier and TypeMethod and Description
public void
addElement(XSElementDecl element, boolean isOptional)

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

pack-priv Object
findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler)

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:

an element decl object
oneTransition
(QName elementName, int[]
Current state
currentState
,
SubstitutionGroupHandler subGroupHandler)

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

The method corresponds to one transition 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

fAllElementsback to summary
private XSElementDecl[] fAllElements
fHasOptionalContentback to summary
private boolean fHasOptionalContent
fIsOptionalElementback to summary
private boolean[] fIsOptionalElement
fNumElementsback to summary
private int fNumElements
STATE_CHILDback to summary
private static final short STATE_CHILD
STATE_STARTback to summary
private static final short STATE_START
STATE_VALIDback to summary
private static final short STATE_VALID

Constructor Detail

XSAllCMback to summary
public XSAllCM(boolean hasOptionalContent, int size)

Method Detail

addElementback to summary
public void addElement(XSElementDecl element, boolean isOptional)
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

findMatchingDeclback to summary
pack-priv Object findMatchingDecl(QName elementName, SubstitutionGroupHandler subGroupHandler)
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 transition in the content model.

Parameters
currentState:int[]

Current state

Returns:Object

an element decl object

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.