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

public Interface XSCMValidator

Known Direct Implementers
com.sun.org.apache.xerces.internal.impl.xs.models.XSDFACM, com.sun.org.apache.xerces.internal.impl.xs.models.XSEmptyCM, com.sun.org.apache.xerces.internal.impl.xs.models.XSAllCM
Imports
com.sun.org.apache.xerces.internal.impl.xs.SubstitutionGroupHandler, .XMLSchemaException, com.sun.org.apache.xerces.internal.xni.QName, java.util.List

Note

State of the content model is stored in the validator

Authors
Sandy Gao, IBM, Elena Litani, IBM

Field Summary

Modifier and TypeField and Description
public static final short
public static final short

Method Summary

Modifier and TypeMethod and Description
public List<String>

Returns:

null if validation of bounds is successful. Returns a list of strings with error info if not. Even entries in list returned are error codes (used to look up properties) and odd entries are parameters to be passed when formatting error message. Each parameter is associated with the error code that proceeds it in the list.
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
)

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
state
)

The method indicates the end of list of children

public String

Returns:

the name of the element declaration or wildcard
getTermName
(int
identifier for the element declaration or wildcard
termId
)

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

public boolean

Returns:

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

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

public int[]

Returns:

an array containing information about the current repeating term
occurenceInfo
(int[]
the current state
state
)

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 decl or wildcard decl that corresponds to the element from the Schema grammar
oneTransition
(QName elementName, int[]
Current state
state
,
SubstitutionGroupHandler subGroupHandler)

The method corresponds to one transaction in the content model.

public int[]

Returns:

Start state of the content model
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
)

Check which elements are valid to appear at this point.

Field Detail

FIRST_ERRORback to summary
public static final short FIRST_ERROR
SUBSEQUENT_ERRORback to summary
public static final short SUBSEQUENT_ERROR

Method Detail

checkMinMaxBoundsback to summary
public List<String> 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.

Returns:List<String>

null if validation of bounds is successful. Returns a list of strings with error info if not. Even entries in list returned are error codes (used to look up properties) and odd entries are parameters to be passed when formatting error message. Each parameter is associated with the error code that proceeds it in the list.

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

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[] state)

The method indicates the end of list of children

Parameters
state: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)

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()

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)

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[] state, SubstitutionGroupHandler subGroupHandler)

The method corresponds to one transaction in the content model.

Parameters
state:int[]

Current state

Returns:Object

element decl or wildcard decl that corresponds to the element from the Schema grammar

startContentModelback to summary
public int[] 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)

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.