Package org.apache.commons.jxpath.xml

# Class XMLParser2

java.lang.Object
org.apache.commons.jxpath.xml.XMLParser2

All Implemented Interfaces:
  `XMLParser`

Direct Known Subclasses:
  `DocumentContainer`, `DOMParser`, `JDOMParser`

public abstract class XMLParser2 extends Object implements XMLParser
The abstract superclass of XML parsers that produce DOM Documents. The features have the same defaults as `DocumentBuilderFactory`.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XMLParser2()`
  Constructs a new instance for subclasses.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `isCoalescing()`
  Tests whether the underlying parser is coalescing.
  `boolean`
  `isExpandEntityReferences()`
  Tests whether the underlying parser expands entity references.
  `boolean`
  `isIgnoringComments()`
  Tests whether the underlying parser ignores comments.
  `boolean`
  `isIgnoringElementContentWhitespace()`
  Tests whether the underlying parser is ignoring whitespace.
  `boolean`
  `isNamespaceAware()`
  Tests whether the underlying parser is ns-aware.
  `boolean`
  `isValidating()`
  Tests whether the underlying parser is validating.
  `abstract Object`
  `parseXML(InputStream stream)`
  Reads the supplied XML file and returns the resulting model, which is not necessarily DOM.
  `void`
  `setCoalescing(boolean coalescing)`
  Sets whether the underlying parser is coalescing.
  `void`
  `setExpandEntityReferences(boolean expandEntityRef)`
  Sets whether the underlying parser expands entity references.
  `void`
  `setIgnoringComments(boolean ignoreComments)`
  Sets whether the underlying parser ignores comments.
  `void`
  `setIgnoringElementContentWhitespace(boolean whitespace)`
  Sets whether the underlying parser is ignoring whitespace.
  `void`
  `setNamespaceAware(boolean namespaceAware)`
  Sets whether the underlying parser is ns-aware.
  `void`
  `setValidating(boolean validating)`
  Sets whether the underlying parser should be validating.

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

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

- ## Constructor Details

  - ### XMLParser2

    public XMLParser2()
    Constructs a new instance for subclasses.

- ## Method Details

  - ### isCoalescing

    public boolean isCoalescing()
    Tests whether the underlying parser is coalescing.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isCoalescing()`

  - ### isExpandEntityReferences

    public boolean isExpandEntityReferences()
    Tests whether the underlying parser expands entity references.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isExpandEntityReferences()`

  - ### isIgnoringComments

    public boolean isIgnoringComments()
    Tests whether the underlying parser ignores comments.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isIgnoringComments()`

  - ### isIgnoringElementContentWhitespace

    public boolean isIgnoringElementContentWhitespace()
    Tests whether the underlying parser is ignoring whitespace.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isIgnoringElementContentWhitespace()`

  - ### isNamespaceAware

    public boolean isNamespaceAware()
    Tests whether the underlying parser is ns-aware.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isNamespaceAware()`

  - ### isValidating

    public boolean isValidating()
    Tests whether the underlying parser is validating.
    Returns:
      boolean
    See Also:
      - `DocumentBuilderFactory.isValidating()`

  - ### parseXML

    public abstract Object parseXML(InputStream stream)
    Description copied from interface: `XMLParser`
    Reads the supplied XML file and returns the resulting model, which is not necessarily DOM.
    Specified by:
      `parseXML` in interface `XMLParser`
    Parameters:
      `stream` - InputStream
    Returns:
      Object

  - ### setCoalescing

    public void setCoalescing(boolean coalescing)
    Sets whether the underlying parser is coalescing.
    Parameters:
      `coalescing` - flag
    See Also:
      - `DocumentBuilderFactory.setCoalescing(boolean)`

  - ### setExpandEntityReferences

    public void setExpandEntityReferences(boolean expandEntityRef)
    Sets whether the underlying parser expands entity references.
    Parameters:
      `expandEntityRef` - flag
    See Also:
      - `DocumentBuilderFactory.setExpandEntityReferences(boolean)`

  - ### setIgnoringComments

    public void setIgnoringComments(boolean ignoreComments)
    Sets whether the underlying parser ignores comments.
    Parameters:
      `ignoreComments` - flag
    See Also:
      - `DocumentBuilderFactory.setIgnoringComments(boolean)`

  - ### setIgnoringElementContentWhitespace

    public void setIgnoringElementContentWhitespace(boolean whitespace)
    Sets whether the underlying parser is ignoring whitespace.
    Parameters:
      `whitespace` - flag
    See Also:
      - `DocumentBuilderFactory.setIgnoringElementContentWhitespace(boolean)`

  - ### setNamespaceAware

    public void setNamespaceAware(boolean namespaceAware)
    Sets whether the underlying parser is ns-aware.
    Parameters:
      `namespaceAware` - flag
    See Also:
      - `DocumentBuilderFactory.setNamespaceAware(boolean)`

  - ### setValidating

    public void setValidating(boolean validating)
    Sets whether the underlying parser should be validating.
    Parameters:
      `validating` - flag
    See Also:
      - `DocumentBuilderFactory.setValidating(boolean)`