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 intprotected StringThis member stores the current group path.protected IDataSinkThis member is used as the output medium.protected ILoggerThis member is used for reporting errors and warnings.protected StringBufferThis member stores the current indentation.protected StringBufferThis member is stores the currently processed OSAR in XML format.protected StringThis member stores the type of the current processed OSAR.protected final charThis constant member is the group separator in OSAR attribute IDs -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanThis function is called when a new OSAR attribute is added to the currently processed OSAR.protected voidcloseGroups(String groupPath) protected voidprotected voidprotected voidfinal IDataSinkstatic intprotected intgetDiffStartIndex(String groups1, String groups2) protected voidbooleanThis function is used to check if the object is fully functional.protected voidopenGroups(String groupPath) voidsetDataSink(IDataSink iDataSink) This function is used to initialize the data sinkstatic voidsetDebugLevel(int debugLevel) booleanThis 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:IOSAROutputThis function is used to initialize the data sink- Specified by:
setDataSinkin interfaceIOSAROutput
-
storeOSAR
This function is called when a new OSAR is to be processed.- Specified by:
storeOSARin 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:
isHealthyin 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
-