Class OMDOMReader

java.lang.Object
org.episteme.core.mathematics.loaders.openmath.io.OMDOMReader

public class OMDOMReader extends Object
An OpenMath DOM reader.

Version:
$Revision: 1.2 $
Author:
Manfred N. Riem (mriem@manorrock.org)
  • Field Details

    • sOMObjects

      protected static String[] sOMObjects
      Stores a static array with all the OpenMath element-names in use.

    • mInputSource

      protected InputSource mInputSource
      Stores the input-source if we use one.

    • mNode

      protected Node mNode
      Stores the node we want to read the OMObject from.

  • Constructor Details

    • OMDOMReader

      public OMDOMReader(Document document)
      Constructor.

      Parameters:
      document - the document to read using the reader.
    • OMDOMReader

      public OMDOMReader(DocumentFragment fragment)
      Constructor.

      Parameters:
      fragment - the document fragment to read using the reader.
    • OMDOMReader

      public OMDOMReader(Node node)
      Constructor.

      Parameters:
      node - the node to read using the reader.
    • OMDOMReader

      public OMDOMReader(InputSource inputSource)
      Constructor.

      Parameters:
      inputSource - the InputSource to read from using this reader.
    • OMDOMReader

      public OMDOMReader(String string)
      Constructor.

      Parameters:
      string - the string to read from using this reader.
  • Method Details

    • readObject

      public OMObject readObject() throws IOException
      Read an OpenMath object.

      1. If we are a document then get the nodelist that contains an OMOBJ. Take the first of the list and read that object.

      2. Or if we are a document fragment assume the first child is the OMObject.

      3. Or just assume the node contains the OMObject.

      Returns:
      the OpenMath object.
      Throws:
      IOException - when a problem arises while reading.