Class CXML_OSAROutput

java.lang.Object
com.nt.udc.io.xml.CXML_OSAROutput
All Implemented Interfaces:
IOSAROutput

public class CXML_OSAROutput extends Object implements IOSAROutput
This class is used to output OSAR records in XML format.
  • Field Details

    • m_separator

      protected final char m_separator
      This constant member is the group separator in OSAR attribute IDs
      See Also:
    • m_debugLevel

      protected static int m_debugLevel
    • m_iLogger

      protected ILogger m_iLogger
      This member is used for reporting errors and warnings.
    • m_osarXML

      protected StringBuffer m_osarXML
      This member is stores the currently processed OSAR in XML format.
    • m_recordType

      protected String m_recordType
      This member stores the type of the current processed OSAR.
    • m_groups

      protected String m_groups
      This member stores the current group path.
    • m_indentation

      protected StringBuffer m_indentation
      This member stores the current indentation.
    • m_iDataSink

      protected IDataSink m_iDataSink
      This member is used as the output medium.
  • Constructor Details

    • CXML_OSAROutput

      public CXML_OSAROutput(ILogger iLogger)
  • Method Details

    • getDebugLevel

      public static int getDebugLevel()
    • getDataSink

      public final IDataSink getDataSink()
    • setDebugLevel

      public static void setDebugLevel(int debugLevel)
    • setDataSink

      public void setDataSink(IDataSink iDataSink)
      Description copied from interface: IOSAROutput
      This function is used to initialize the data sink
      Specified by:
      setDataSink in interface IOSAROutput
    • storeOSAR

      public boolean storeOSAR(COSAR osar)
      This function is called when a new OSAR is to be processed.
      Specified by:
      storeOSAR in interface IOSAROutput
      Returns:
      true if successul, false otherwise
    • isHealthy

      public boolean isHealthy()
      This function is used to check if the object is fully functional.
      Specified by:
      isHealthy in interface IOSAROutput
    • addAttr

      protected boolean addAttr(COSARAttr osarAttr)
      This function is called when a new OSAR attribute is added to the currently processed OSAR.

      Attribute grouping must be handled. An attribute may be part of a list of nested groups. In that case, its ID will contain the names of those groups, separated by colons, as well as the attribute's name.

      Example: ID = "group1:group2:name"

      The function compares the groups of consecutive attributes and generates XML code appropriately for closing old groups and opening new ones, if necessary.

      Example: attr1_id = "group1:group2:name1", attr2_id = "group1:group3:name2"

      The generated XML code is:

      val1 val2

      Returns:
      true if successful, false otherwise
    • openGroups

      protected void openGroups(String groupPath)
    • closeGroups

      protected void closeGroups(String groupPath)
    • increaseIndentation

      protected void increaseIndentation()
    • decreaseIndentation

      protected void decreaseIndentation()
    • getDiffStartIndex

      protected int getDiffStartIndex(String groups1, String groups2)
    • error

      protected void error(String fName, String msg)
    • debug

      protected void debug(String fName, String msg)