Package com.ctc.wstx.dtd
Class ChoiceContentSpec.Validator
- java.lang.Object
-
- com.ctc.wstx.dtd.StructValidator
-
- com.ctc.wstx.dtd.ChoiceContentSpec.Validator
-
- Enclosing class:
- ChoiceContentSpec
static final class ChoiceContentSpec.Validator extends StructValidator
-
-
Field Summary
Fields Modifier and Type Field Description (package private) char
mArity
(package private) int
mCount
(package private) PrefixedNameSet
mNames
-
Constructor Summary
Constructors Constructor Description Validator(char arity, PrefixedNameSet names)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
fullyValid()
Method called when the end element of the scope this validator validates is encountered.StructValidator
newInstance()
Rules for reuse are simple: if we can have any number of repetitions, we can just use a shared root 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 PrefixedNameSet mNames
-
mCount
int mCount
-
-
Constructor Detail
-
Validator
public Validator(char arity, PrefixedNameSet names)
-
-
Method Detail
-
newInstance
public 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.- 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.
-
-