Package com.ctc.wstx.dtd
Class SeqContentSpec.Validator
- java.lang.Object
-
- com.ctc.wstx.dtd.StructValidator
-
- com.ctc.wstx.dtd.SeqContentSpec.Validator
-
- Enclosing class:
- SeqContentSpec
static final class SeqContentSpec.Validator extends StructValidator
Simple validator that can be used if all components of a sequence are leaf nodes, ie. elements with no explicit arity modifiers.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) char
mArity
(package private) PrefixedName[]
mNames
(package private) int
mRounds
Number of full repetitions done over the sequence(package private) int
mStep
Expected next element in the sequence
-
Constructor Summary
Constructors Constructor Description Validator(char arity, PrefixedName[] names)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.String
concatNames(PrefixedName[] names)
private java.lang.String
expElem(int step)
java.lang.String
fullyValid()
Method called when the end element of the scope this validator validates is encountered.StructValidator
newInstance()
Sequence content specification is always stateful; can not use a shared instance...java.lang.String
tryToValidate(PrefixedName elemName)
Method called when a new (start) element is encountered within the scope of parent element this validator monitors.
-
-
-
Field Detail
-
mArity
final char mArity
-
mNames
final PrefixedName[] mNames
-
mRounds
int mRounds
Number of full repetitions done over the sequence
-
mStep
int mStep
Expected next element in the sequence
-
-
Constructor Detail
-
Validator
public Validator(char arity, PrefixedName[] names)
-
-
Method Detail
-
newInstance
public StructValidator newInstance()
Sequence content specification is always stateful; can not use a shared instance... so let's create new instance:- Specified by:
newInstance
in classStructValidator
-
tryToValidate
public java.lang.String tryToValidate(PrefixedName elemName)
Description copied from class:StructValidator
Method called when a new (start) element is encountered within the scope of parent element this validator monitors.- Specified by:
tryToValidate
in classStructValidator
- Returns:
- Null if element is valid in its current position; error message if not.
-
fullyValid
public java.lang.String fullyValid()
Description copied from class:StructValidator
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.- Specified by:
fullyValid
in classStructValidator
- Returns:
- Null if the content model for the element is valid; error message if not.
-
expElem
private java.lang.String expElem(int step)
-
concatNames
static final java.lang.String concatNames(PrefixedName[] names)
-
-