Package com.nt.udc.io.xml
Class CXML_OSAROutput
java.lang.Object
com.nt.udc.io.xml.CXML_OSAROutput
- All Implemented Interfaces:
IOSAROutput
This class is used to output OSAR records in XML format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static int
protected String
This member stores the current group path.protected IDataSink
This member is used as the output medium.protected ILogger
This member is used for reporting errors and warnings.protected StringBuffer
This member stores the current indentation.protected StringBuffer
This member is stores the currently processed OSAR in XML format.protected String
This member stores the type of the current processed OSAR.protected final char
This constant member is the group separator in OSAR attribute IDs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
This function is called when a new OSAR attribute is added to the currently processed OSAR.protected void
closeGroups
(String groupPath) protected void
protected void
protected void
final IDataSink
static int
protected int
getDiffStartIndex
(String groups1, String groups2) protected void
boolean
This function is used to check if the object is fully functional.protected void
openGroups
(String groupPath) void
setDataSink
(IDataSink iDataSink) This function is used to initialize the data sinkstatic void
setDebugLevel
(int debugLevel) boolean
This function is called when a new OSAR is to be processed.
-
Field Details
-
m_separator
protected final char m_separatorThis constant member is the group separator in OSAR attribute IDs- See Also:
-
m_debugLevel
protected static int m_debugLevel -
m_iLogger
This member is used for reporting errors and warnings. -
m_osarXML
This member is stores the currently processed OSAR in XML format. -
m_recordType
This member stores the type of the current processed OSAR. -
m_groups
This member stores the current group path. -
m_indentation
This member stores the current indentation. -
m_iDataSink
This member is used as the output medium.
-
-
Constructor Details
-
CXML_OSAROutput
-
-
Method Details
-
getDebugLevel
public static int getDebugLevel() -
getDataSink
-
setDebugLevel
public static void setDebugLevel(int debugLevel) -
setDataSink
Description copied from interface:IOSAROutput
This function is used to initialize the data sink- Specified by:
setDataSink
in interfaceIOSAROutput
-
storeOSAR
This function is called when a new OSAR is to be processed.- Specified by:
storeOSAR
in interfaceIOSAROutput
- 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 interfaceIOSAROutput
-
addAttr
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
-
closeGroups
-
increaseIndentation
protected void increaseIndentation() -
decreaseIndentation
protected void decreaseIndentation() -
getDiffStartIndex
-
error
-
debug
-