Top Description Inners Fields Constructors Methods
com.ctc.wstx.dtd

public Class SeqContentSpec

extends ContentSpec
Class Inheritance
Imports
java.util.*, com.ctc.wstx.util.PrefixedName

Content specification that defines model that has sequence of one or more elements that have to come in the specified order.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
SeqContentSpec.Validator

Simple validator that can be used if all components of a sequence are leaf nodes, ie.

Field Summary

Modifier and TypeField and Description
pack-priv final ContentSpec[]
pack-priv final boolean
Inherited from com.ctc.wstx.dtd.ContentSpec:
mArity

Constructor Summary

AccessConstructor and Description
public
SeqContentSpec(boolean nsAware, char arity, ContentSpec[] subSpecs)

Method Summary

Modifier and TypeMethod and Description
public static SeqContentSpec
construct(boolean nsAware, char arity, Collection<ContentSpec> subSpecs)

public StructValidator
getSimpleValidator()

Implements abstract com.ctc.wstx.dtd.ContentSpec.getSimpleValidator.

Method called by input element stack to get validator for this content specification, if this specification is simple enough not to need full DFA-based validator.

public ModelNode
rewrite()

Implements abstract com.ctc.wstx.dtd.ContentSpec.rewrite.

Method called as the first part of DFA construction, if necessary; will usually create simpler ModelNode instances that will match definition this instance contains.

private ModelNode
rewrite(ContentSpec[] specs, int first, int last)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from com.ctc.wstx.dtd.ContentSpec:
getArityisLeafsetArity

Field Detail

mContentSpecsback to summary
pack-priv final ContentSpec[] mContentSpecs
mNsAwareback to summary
pack-priv final boolean mNsAware

Constructor Detail

SeqContentSpecback to summary
public SeqContentSpec(boolean nsAware, char arity, ContentSpec[] subSpecs)

Method Detail

constructback to summary
public static SeqContentSpec construct(boolean nsAware, char arity, Collection<ContentSpec> subSpecs)
getSimpleValidatorback to summary
public StructValidator getSimpleValidator()

Implements abstract com.ctc.wstx.dtd.ContentSpec.getSimpleValidator.

Doc from com.ctc.wstx.dtd.ContentSpec.getSimpleValidator.

Method called by input element stack to get validator for this content specification, if this specification is simple enough not to need full DFA-based validator.

Returns:StructValidator

Simple content model validator, if one can be directly constructed, or null to indicate that a DFA needs to be created.

Annotations
@Override
rewriteback to summary
public ModelNode rewrite()

Implements abstract com.ctc.wstx.dtd.ContentSpec.rewrite.

Doc from com.ctc.wstx.dtd.ContentSpec.rewrite.

Method called as the first part of DFA construction, if necessary; will usually create simpler ModelNode instances that will match definition this instance contains.

Annotations
@Override
rewriteback to summary
private ModelNode rewrite(ContentSpec[] specs, int first, int last)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override
com.ctc.wstx.dtd back to summary

pack-priv final Class SeqContentSpec.Validator

extends StructValidator
Class Inheritance

Simple validator that can be used if all components of a sequence are leaf nodes, ie. elements with no explicit arity modifiers.

Field Summary

Modifier and TypeField and Description
pack-priv final char
pack-priv final PrefixedName[]
pack-priv int
mRounds

Number of full repetitions done over the sequence

pack-priv int
mStep

Expected next element in the sequence

Constructor Summary

AccessConstructor and Description
public
Validator(char arity, PrefixedName[] names)

Method Summary

Modifier and TypeMethod and Description
pack-priv static final String
private String
expElem(int step)

public String
fullyValid()

Implements abstract com.ctc.wstx.dtd.StructValidator.fullyValid.

Method called when the end element of the scope this validator validates is encountered.

public StructValidator
newInstance()

Implements abstract com.ctc.wstx.dtd.StructValidator.newInstance.

Sequence content specification is always stateful; can not use a shared instance...

public String
tryToValidate(PrefixedName elemName)

Implements abstract com.ctc.wstx.dtd.StructValidator.tryToValidate.

Method called when a new (start) element is encountered within the scope of parent element this validator monitors.

Field Detail

mArityback to summary
pack-priv final char mArity
mNamesback to summary
pack-priv final PrefixedName[] mNames
mRoundsback to summary
pack-priv int mRounds

Number of full repetitions done over the sequence

mStepback to summary
pack-priv int mStep

Expected next element in the sequence

Constructor Detail

Validatorback to summary
public Validator(char arity, PrefixedName[] names)

Method Detail

concatNamesback to summary
pack-priv static final String concatNames(PrefixedName[] names)
expElemback to summary
private String expElem(int step)
fullyValidback to summary
public String fullyValid()

Implements abstract com.ctc.wstx.dtd.StructValidator.fullyValid.

Doc from com.ctc.wstx.dtd.StructValidator.fullyValid.

Method called when the end element of the scope this validator validates is encountered. It should make sure that the content model is valid, and if not, to construct an error message.

Returns:String

Null if the content model for the element is valid; error message if not.

Annotations
@Override
newInstanceback to summary
public StructValidator newInstance()

Implements abstract com.ctc.wstx.dtd.StructValidator.newInstance.

Sequence content specification is always stateful; can not use a shared instance... so let's create new instance:

Annotations
@Override
tryToValidateback to summary
public String tryToValidate(PrefixedName elemName)

Implements abstract com.ctc.wstx.dtd.StructValidator.tryToValidate.

Doc from com.ctc.wstx.dtd.StructValidator.tryToValidate.

Method called when a new (start) element is encountered within the scope of parent element this validator monitors.

Returns:String

Null if element is valid in its current position; error message if not.

Annotations
@Override