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

public Class TokenContentSpec

extends ContentSpec
Class Inheritance
Imports
com.ctc.wstx.cfg.ErrorConsts, com.ctc.wstx.util.PrefixedName

Content specification that defines content model consisting of just one allowed element. In addition to the allowed element, spec can have optional arity ("*", "+", "?") marker.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
pack-priv final PrefixedName
pack-priv static final TokenContentSpec
Inherited from com.ctc.wstx.dtd.ContentSpec:
mArity

Constructor Summary

AccessConstructor and Description
public
TokenContentSpec(char arity, PrefixedName elemName)

Method Summary

Modifier and TypeMethod and Description
public static TokenContentSpec
construct(char arity, PrefixedName elemName)

public static TokenContentSpec
public PrefixedName
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 boolean
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:
getAritysetArity

Field Detail

mElemNameback to summary
pack-priv final PrefixedName mElemName
sDummyback to summary
pack-priv static final TokenContentSpec sDummy

Constructor Detail

TokenContentSpecback to summary
public TokenContentSpec(char arity, PrefixedName elemName)

Method Detail

constructback to summary
public static TokenContentSpec construct(char arity, PrefixedName elemName)
getDummySpecback to summary
public static TokenContentSpec getDummySpec()
getNameback to summary
public PrefixedName getName()
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
isLeafback to summary
public boolean isLeaf()

Overrides com.ctc.wstx.dtd.ContentSpec.isLeaf.

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
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 TokenContentSpec.Validator

extends StructValidator
Class Inheritance

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
Validator(char arity, PrefixedName elemName)

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
mElemNameback to summary
pack-priv final PrefixedName mElemName

Constructor Detail

Validatorback to summary
public Validator(char arity, PrefixedName elemName)

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