FileDocCategorySizeDatePackage
ConfigurableValidationState.javaAPI DocApache Xerces 3.0.14211Fri Sep 14 20:33:56 BST 2007org.apache.xerces.impl.validation

ConfigurableValidationState

public final class ConfigurableValidationState extends ValidationState

An extension of ValidationState which can be configured to turn off checking for ID/IDREF errors and unparsed entity errors.

xerces.internal
author
Peter McCracken, IBM
version
$Id: ConfigurableValidationState.java 449320 2006-09-23 22:37:56Z mrglavas $

Fields Summary
private boolean
fIdIdrefChecking
Whether to check for ID/IDREF errors
private boolean
fUnparsedEntityChecking
Whether to check for unparsed entity errors
Constructors Summary
public ConfigurableValidationState()
Creates a new ConfigurableValidationState. By default, error checking for both ID/IDREFs and unparsed entities are turned on.

        super();
        fIdIdrefChecking = true;
        fUnparsedEntityChecking = true;
    
Methods Summary
public voidaddId(java.lang.String name)
Adds the ID, if ID/IDREF checking is enabled.

param
name the ID to add

        if (fIdIdrefChecking) {
            super.addId(name);
        }
    
public voidaddIdRef(java.lang.String name)
Adds the IDREF, if ID/IDREF checking is enabled.

param
name the IDREF to add

        if (fIdIdrefChecking) {
            super.addIdRef(name);
        }
    
public java.lang.StringcheckIDRefID()
Checks if all IDREFs have a corresponding ID.

return
null, if ID/IDREF checking is turned off otherwise, returns the value of the super implementation

        return (fIdIdrefChecking) ? super.checkIDRefID() : null;
    
public booleanisEntityDeclared(java.lang.String name)
Checks if an entity is declared.

return
true, if unparsed entity checking is turned off otherwise, returns the value of the super implementation

        return (fUnparsedEntityChecking) ? super.isEntityDeclared(name) : true;
    
public booleanisEntityUnparsed(java.lang.String name)
Checks if an entity is unparsed.

return
true, if unparsed entity checking is turned off otherwise, returns the value of the super implementation

        return (fUnparsedEntityChecking) ? super.isEntityUnparsed(name) : true;
    
public booleanisIdDeclared(java.lang.String name)
Checks if an ID has already been declared.

return
false, if ID/IDREF checking is turned off otherwise, returns the value of the super implementation

        return (fIdIdrefChecking) ? super.isIdDeclared(name) : false;
    
public voidsetIdIdrefChecking(boolean setting)
Turns checking for ID/IDREF errors on and off.

param
setting true to turn on error checking, false to turn off error checking

        fIdIdrefChecking = setting;
    
public voidsetUnparsedEntityChecking(boolean setting)
Turns checking for unparsed entity errors on and off.

param
setting true to turn on error checking, false to turn off error checking

        fUnparsedEntityChecking = setting;