org.apache.xerces.impl.validation

## Class ConfigurableValidationState

- java.lang.Object
- - org.apache.xerces.impl.validation.ValidationState
  - - org.apache.xerces.impl.validation.ConfigurableValidationState

- All Implemented Interfaces:
    ValidationContext

      public class ConfigurableValidationState
      extends ValidationState

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

  Version:
    $Id: ConfigurableValidationState.java 1380447 2012-09-04 04:46:01Z mrglavas $
  Author:
    Peter McCracken, IBM

  # INTERNAL:

    Usage of this class is not supported. It may be altered or removed at any time.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `fIdIdrefChecking` Whether to check for ID/IDREF errors

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConfigurableValidationState()` Creates a new ConfigurableValidationState.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addId(java.lang.String name)` Adds the ID, if ID/IDREF checking is enabled.
    `void` | `addIdRef(java.lang.String name)` Adds the IDREF, if ID/IDREF checking is enabled.
    `java.util.Iterator` | `checkIDRefID()` Checks if all IDREFs have a corresponding ID.
    `boolean` | `isEntityDeclared(java.lang.String name)` Checks if an entity is declared.
    `boolean` | `isEntityUnparsed(java.lang.String name)` Checks if an entity is unparsed.
    `boolean` | `isIdDeclared(java.lang.String name)` Checks if an ID has already been declared.
    `void` | `setIdIdrefChecking(boolean setting)` Turns checking for ID/IDREF errors on and off.
    `void` | `setUnparsedEntityChecking(boolean setting)` Turns checking for unparsed entity errors on and off.

    - ### Methods inherited from class org.apache.xerces.impl.validation.ValidationState

      `containsID, getDatatypeXMLVersion, getLocale, getSymbol, getTypeValidatorHelper, getURI, needExtraChecking, needFacetChecking, needToNormalize, reset, resetIDTables, setDatatypeXMLVersion, setEntityState, setExtraChecking, setFacetChecking, setLocale, setNamespaceSupport, setNormalizationRequired, setSymbolTable, setTypeValidatorHelper, setUsingNamespaces, useNamespaces`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### fIdIdrefChecking

          protected boolean fIdIdrefChecking

      Whether to check for ID/IDREF errors

  - ### Constructor Detail

    - #### ConfigurableValidationState

          public ConfigurableValidationState()

      Creates a new ConfigurableValidationState. By default, error checking for both ID/IDREFs and unparsed entities are turned on.

  - ### Method Detail

    - #### setIdIdrefChecking

          public final void setIdIdrefChecking(boolean setting)

      Turns checking for ID/IDREF errors on and off.
      Parameters:
        `setting` - true to turn on error checking, false to turn off error checking

    - #### setUnparsedEntityChecking

          public final void setUnparsedEntityChecking(boolean setting)

      Turns checking for unparsed entity errors on and off.
      Parameters:
        `setting` - true to turn on error checking, false to turn off error checking

    - #### checkIDRefID

          public final java.util.Iterator checkIDRefID()

      Checks if all IDREFs have a corresponding ID.
      Overrides:
        `checkIDRefID` in class `ValidationState`
      Returns:
        null, if ID/IDREF checking is turned off otherwise, returns the value of the super implementation

    - #### isIdDeclared

          public boolean isIdDeclared(java.lang.String name)

      Checks if an ID has already been declared.
      Specified by:
        `isIdDeclared` in interface `ValidationContext`
      Overrides:
        `isIdDeclared` in class `ValidationState`
      Returns:
        false, if ID/IDREF checking is turned off otherwise, returns the value of the super implementation

    - #### isEntityDeclared

          public final boolean isEntityDeclared(java.lang.String name)

      Checks if an entity is declared.
      Specified by:
        `isEntityDeclared` in interface `ValidationContext`
      Overrides:
        `isEntityDeclared` in class `ValidationState`
      Returns:
        true, if unparsed entity checking is turned off otherwise, returns the value of the super implementation

    - #### isEntityUnparsed

          public final boolean isEntityUnparsed(java.lang.String name)

      Checks if an entity is unparsed.
      Specified by:
        `isEntityUnparsed` in interface `ValidationContext`
      Overrides:
        `isEntityUnparsed` in class `ValidationState`
      Returns:
        true, if unparsed entity checking is turned off otherwise, returns the value of the super implementation

    - #### addId

          public void addId(java.lang.String name)

      Adds the ID, if ID/IDREF checking is enabled.
      Specified by:
        `addId` in interface `ValidationContext`
      Overrides:
        `addId` in class `ValidationState`
      Parameters:
        `name` - the ID to add

    - #### addIdRef

          public final void addIdRef(java.lang.String name)

      Adds the IDREF, if ID/IDREF checking is enabled.
      Specified by:
        `addIdRef` in interface `ValidationContext`
      Overrides:
        `addIdRef` in class `ValidationState`
      Parameters:
        `name` - the IDREF to add

Copyright © 1999-2022 The Apache Software Foundation. All Rights Reserved.