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

public Class EmptyValidator

extends StructValidator
Class Inheritance
Imports
com.ctc.wstx.util.PrefixedName

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

Modifier and TypeField and Description
pack-priv final String
pack-priv static final EmptyValidator
pack-priv static final EmptyValidator

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
fullyValid()

Implements abstract com.ctc.wstx.dtd.StructValidator.fullyValid.

If we ever get as far as element closing, things are all good; can just return null.

public static EmptyValidator
public static EmptyValidator
public StructValidator
newInstance()

Implements abstract com.ctc.wstx.dtd.StructValidator.newInstance.

Simple; can always (re)use instance itself; no state information is kept.

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

mErrorMsgback to summary
pack-priv final String mErrorMsg
sEmptyInstanceback to summary
pack-priv static final EmptyValidator sEmptyInstance
sPcdataInstanceback to summary
pack-priv static final EmptyValidator sPcdataInstance

Constructor Detail

EmptyValidatorback to summary
private EmptyValidator(String errorMsg)

Method Detail

fullyValidback to summary
public String fullyValid()

Implements abstract com.ctc.wstx.dtd.StructValidator.fullyValid.

If we ever get as far as element closing, things are all good; can just return null.

Returns:String

Doc from com.ctc.wstx.dtd.StructValidator.fullyValid.

Null if the content model for the element is valid; error message if not.

Annotations
@Override
getEmptyInstanceback to summary
public static EmptyValidator getEmptyInstance()
getPcdataInstanceback to summary
public static EmptyValidator getPcdataInstance()
newInstanceback to summary
public StructValidator newInstance()

Implements abstract com.ctc.wstx.dtd.StructValidator.newInstance.

Simple; can always (re)use instance itself; no state information is kept.

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