Package com.ctc.wstx.dtd
Class EmptyValidator
- java.lang.Object
-
- com.ctc.wstx.dtd.StructValidator
-
- com.ctc.wstx.dtd.EmptyValidator
-
public class EmptyValidator extends StructValidator
Simple content model validator that accepts no elements, ever; this is true for pure #PCDATA content model as well as EMPTY content model. Can be used as a singleton, since all info needed for diagnostics is passed via methods.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) java.lang.String
mErrorMsg
(package private) static EmptyValidator
sEmptyInstance
(package private) static EmptyValidator
sPcdataInstance
-
Constructor Summary
Constructors Modifier Constructor Description private
EmptyValidator(java.lang.String errorMsg)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
fullyValid()
If we ever get as far as element closing, things are all good; can just return null.static EmptyValidator
getEmptyInstance()
static EmptyValidator
getPcdataInstance()
StructValidator
newInstance()
Simple; can always (re)use instance itself; no state information is kept.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
-
sPcdataInstance
static final EmptyValidator sPcdataInstance
-
sEmptyInstance
static final EmptyValidator sEmptyInstance
-
mErrorMsg
final java.lang.String mErrorMsg
-
-
Method Detail
-
getPcdataInstance
public static EmptyValidator getPcdataInstance()
-
getEmptyInstance
public static EmptyValidator getEmptyInstance()
-
newInstance
public StructValidator newInstance()
Simple; can always (re)use instance itself; no state information is kept.- 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()
If we ever get as far as element closing, things are all good; can just return null.- Specified by:
fullyValid
in classStructValidator
- Returns:
- Null if the content model for the element is valid; error message if not.
-
-