Class EDRViewer

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class EDRViewer extends JPanel
EDRViewerPanel affords viewing contents of a serialized EDR. A tree-table is used to display fields in a hierarchical structure.

The primary inputs to the viewer are the EDR to be displayed and a mapping of field ids to edr names. Both inputs are passed in as XML documents in string format. The viewer parses the provided XML prior to displaying its contents. A static method is provides that will parse the serialized EDR with a DOM parser.

Subclassing: EDRViewerPanel is designed to be subclassed. Subclasses should override createNode() factory method.

Since:
6.5FP3
Author:
Max Spivak
See Also:
  • Field Details

    • mTreeTable

      protected JTreeTable mTreeTable
      The tree table is used to display an EDR
  • Constructor Details

    • EDRViewer

      public EDRViewer(String edr, String fieldMapStr) throws EDRViewerException
      Creates the EDRViewer.
      Parameters:
      edr - Serialized EDR: XML document in string format.
      fieldMapStr - Mapping of serialized field ids to EDR field names. XML document in string format.
      Throws:
      EDRViewerException - if EDR cannot be displayed for any reason.
  • Method Details

    • getMainEDRNode

      public EDRTreeTableNode getMainEDRNode()
      Returns top-level node that gets displayed. This node is what gets passed to JTreeTable. (Note that this is not the DOM node.)
    • createNode

      protected EDRTreeTableNode createNode(Node edr, EDRFieldMap fm)
      Factory method for subclasses should override. Allows subclassed nodes, that support additional functionality, to be created.
      Parameters:
      edr - W3C DOM Node object containing data to display
      fm - FieldMap that maps field ids to field names
    • parseEDR

      public static Node parseEDR(String edrInXMLformat) throws IOException, ParserConfigurationException, SAXException
      Parses the EDR passed in as a string into XML format and returns the node.
      Parameters:
      edrInXMLformat - Serialized EDR in XML string representation
      Throws:
      IOException
      ParserConfigurationException
      SAXException