Package de.pangaea.metadataportal.harvester

## Class OAIMetadataSaxRule

- java.lang.Object
- - org.apache.commons.digester.Rule
  - - de.pangaea.metadataportal.utils.SaxRule
    - - de.pangaea.metadataportal.harvester.OAIMetadataSaxRule

-     public final class OAIMetadataSaxRule
      extends SaxRule

  This class is used as a rule for the "metadata" element of the OAI response. Whenever this element occurs in Digester, it feeds the SAX events to a content handler and stores the DOM result in the `OAIMetadataDocument` on the Digester stack, if rule is not enabled, metadata is fed to nowhere.
  Author:
    Uwe Schindler

- - ### Field Summary

    - ### Fields inherited from class de.pangaea.metadataportal.utils.SaxRule

      `destContentHandler, excludeNamespaces`

    - ### Fields inherited from class org.apache.commons.digester.Rule

      `digester, namespaceURI`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OAIMetadataSaxRule()` | Creates a new rule which is enabled by default.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `begin​(String namespace, String name, Attributes attributes)` |
    `void` | `end​(String namespace, String name)` |
    `boolean` | `isEnabled()` |
    `void` | `setEnabled​(boolean enabled)` | If enabled, a DOM tree is build from metadata.

    - ### Methods inherited from class de.pangaea.metadataportal.utils.SaxRule

      `emptyRule, finishDocument, getContentHandler, initDocument, setContentHandler, setDigester, setExcludeNamespaces`

    - ### Methods inherited from class org.apache.commons.digester.Rule

      `begin, body, body, end, finish, getDigester, getNamespaceURI, setNamespaceURI`

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

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

- - ### Constructor Detail

    - #### OAIMetadataSaxRule

          public OAIMetadataSaxRule()

      Creates a new rule which is enabled by default.

  - ### Method Detail

    - #### setEnabled

          public void setEnabled​(boolean enabled)

      If enabled, a DOM tree is build from metadata. If not enabled, metadata is fed to nowhere (for static OAI repositories to filter wrong metadataPrefix).

    - #### isEnabled

          public boolean isEnabled()

      Returns:
        `true` if storing in DOM tree is enabled

    - #### begin

          public void begin​(String namespace,
                            String name,
                            Attributes attributes)
                     throws Exception

      Overrides:
        `begin` in class `SaxRule`
      Throws:
        `Exception`

    - #### end

          public void end​(String namespace,
                          String name)
                   throws Exception

      Overrides:
        `end` in class `SaxRule`
      Throws:
        `Exception`