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

public Class ChoiceContentSpec

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

Content specification that defines content model that has multiple alternative elements; including mixed content model.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final ContentSpec[]
pack-priv final boolean
mHasMixed

Whether this is a mixed content model; mostly affects String representation

pack-priv final boolean
Inherited from com.ctc.wstx.dtd.ContentSpec:
mArity

Constructor Summary

AccessConstructor and Description
private
ChoiceContentSpec(boolean nsAware, char arity, boolean mixed, ContentSpec[] specs)

private
ChoiceContentSpec(boolean nsAware, char arity, boolean mixed, Collection<ContentSpec> specs)

Method Summary

Modifier and TypeMethod and Description
public static ChoiceContentSpec
constructChoice(boolean nsAware, char arity, Collection<ContentSpec> specs)

public static ChoiceContentSpec
constructMixed(boolean nsAware, Collection<ContentSpec> specs)

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.

protected static PrefixedNameSet
namesetFromSpecs(boolean nsAware, ContentSpec[] specs)

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.

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
mHasMixedback to summary
pack-priv final boolean mHasMixed

Whether this is a mixed content model; mostly affects String representation

mNsAwareback to summary
pack-priv final boolean mNsAware

Constructor Detail

ChoiceContentSpecback to summary
private ChoiceContentSpec(boolean nsAware, char arity, boolean mixed, ContentSpec[] specs)
ChoiceContentSpecback to summary
private ChoiceContentSpec(boolean nsAware, char arity, boolean mixed, Collection<ContentSpec> specs)

Method Detail

constructChoiceback to summary
public static ChoiceContentSpec constructChoice(boolean nsAware, char arity, Collection<ContentSpec> specs)
constructMixedback to summary
public static ChoiceContentSpec constructMixed(boolean nsAware, Collection<ContentSpec> specs)
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
namesetFromSpecsback to summary
protected static PrefixedNameSet namesetFromSpecs(boolean nsAware, ContentSpec[] specs)
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
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 ChoiceContentSpec.Validator

extends StructValidator
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv final char
pack-priv int
pack-priv final PrefixedNameSet

Constructor Summary

AccessConstructor and Description
public
Validator(char arity, PrefixedNameSet names)

Method Summary

Modifier and TypeMethod and Description
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.

Rules for reuse are simple: if we can have any number of repetitions, we can just use a shared root 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
mCountback to summary
pack-priv int mCount
mNamesback to summary
pack-priv final PrefixedNameSet mNames

Constructor Detail

Validatorback to summary
public Validator(char arity, PrefixedNameSet names)

Method Detail

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.

Rules for reuse are simple: if we can have any number of repetitions, we can just use a shared root instance. Although its count variable will get updated this doesn't really matter as it won't be used. Otherwise a new instance has to be created always, to keep track of instance counts.

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