Top Description Fields Constructors Methods
org.apache.xerces.impl.xs.models

public Class XSAllCM

extends Object
implements XSCMValidator
Class Inheritance
All Implemented Interfaces
org.apache.xerces.impl.xs.models.XSCMValidator
Imports
java.util.Vector, org.apache.xerces.impl.xs.SubstitutionGroupHandler, .XMLSchemaException, .XSConstraints, .XSElementDecl, org.apache.xerces.xni.QName

XSAllCM implements XSCMValidator and handles <all>.
Author
Pavani Mukthipudi, Sun Microsystems Inc.
Version
$Id: XSAllCM.java 806363 2009-08-20 21:18:48Z mrglavas $

Field Summary

Modifier and TypeField and Description
private final XSElementDecl[]
private final boolean
private final 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 boolean

Returns:

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

Implements org.apache.xerces.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 org.apache.xerces.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
identifier for the element declaration or wildcard
termId
)

Implements org.apache.xerces.impl.xs.models.XSCMValidator.getTermName.

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

Implements org.apache.xerces.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[]
the current state
state
)

Implements org.apache.xerces.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 org.apache.xerces.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 org.apache.xerces.impl.xs.models.XSCMValidator.startContentModel.

This methods to be called on entering a first element whose type has this content model.
public Vector<E>

Returns:

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

Implements org.apache.xerces.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 final XSElementDecl[] fAllElements
fHasOptionalContentback to summary
private final boolean fHasOptionalContent
fIsOptionalElementback to summary
private final 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)
checkUniqueParticleAttributionback to summary
public boolean checkUniqueParticleAttribution(SubstitutionGroupHandler subGroupHandler) throws XMLSchemaException

Implements org.apache.xerces.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 org.apache.xerces.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 org.apache.xerces.impl.xs.models.XSCMValidator.getTermName.

Doc from org.apache.xerces.impl.xs.models.XSCMValidator.getTermName.

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

Parameters
termId:int

identifier for the element declaration or wildcard

Returns:String

the name of the element declaration or wildcard

isCompactedForUPAback to summary
public boolean isCompactedForUPA()

Implements org.apache.xerces.impl.xs.models.XSCMValidator.isCompactedForUPA.

Doc from org.apache.xerces.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

Returns:boolean

a boolean that says whether this content has been compacted for UPA

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

Implements org.apache.xerces.impl.xs.models.XSCMValidator.occurenceInfo.

Doc from org.apache.xerces.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

Parameters
state:int[]

the current state

Returns:int[]

an array containing information about the current repeating term

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

Implements org.apache.xerces.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 org.apache.xerces.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 Vector<E> whatCanGoHere(int[] state)

Implements org.apache.xerces.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:Vector<E>

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