public class CXML_OSAROutput extends java.lang.Object implements IOSAROutput
Modifier and Type | Field and Description |
---|---|
protected static int |
m_debugLevel |
protected java.lang.String |
m_groups
This member stores the current group path.
|
protected IDataSink |
m_iDataSink
This member is used as the output medium.
|
protected ILogger |
m_iLogger
This member is used for reporting errors and warnings.
|
protected java.lang.StringBuffer |
m_indentation
This member stores the current indentation.
|
protected java.lang.StringBuffer |
m_osarXML
This member is stores the currently processed OSAR
in XML format.
|
protected java.lang.String |
m_recordType
This member stores the type of the current processed OSAR.
|
protected char |
m_separator
This constant member is the group separator in OSAR attribute IDs
|
Constructor and Description |
---|
CXML_OSAROutput(ILogger iLogger) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
addAttr(COSARAttr osarAttr)
This function is called when a new OSAR attribute is added
to the currently processed OSAR.
|
protected void |
closeGroups(java.lang.String groupPath) |
protected void |
debug(java.lang.String fName,
java.lang.String msg) |
protected void |
decreaseIndentation() |
protected void |
error(java.lang.String fName,
java.lang.String msg) |
IDataSink |
getDataSink() |
static int |
getDebugLevel() |
protected int |
getDiffStartIndex(java.lang.String groups1,
java.lang.String groups2) |
protected void |
increaseIndentation() |
boolean |
isHealthy()
This function is used to check if the object is fully functional.
|
protected void |
openGroups(java.lang.String groupPath) |
void |
setDataSink(IDataSink iDataSink)
This function is used to initialize the data sink
|
static void |
setDebugLevel(int debugLevel) |
boolean |
storeOSAR(COSAR osar)
This function is called when a new OSAR is to be processed.
|
protected final char m_separator
protected static int m_debugLevel
protected ILogger m_iLogger
protected java.lang.StringBuffer m_osarXML
protected java.lang.String m_recordType
protected java.lang.String m_groups
protected java.lang.StringBuffer m_indentation
protected IDataSink m_iDataSink
public CXML_OSAROutput(ILogger iLogger)
public static int getDebugLevel()
public final IDataSink getDataSink()
public static void setDebugLevel(int debugLevel)
public void setDataSink(IDataSink iDataSink)
IOSAROutput
setDataSink
in interface IOSAROutput
public boolean storeOSAR(COSAR osar)
storeOSAR
in interface IOSAROutput
public boolean isHealthy()
isHealthy
in interface IOSAROutput
protected boolean addAttr(COSARAttr osarAttr)
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:
protected void openGroups(java.lang.String groupPath)
protected void closeGroups(java.lang.String groupPath)
protected void increaseIndentation()
protected void decreaseIndentation()
protected int getDiffStartIndex(java.lang.String groups1, java.lang.String groups2)
protected void error(java.lang.String fName, java.lang.String msg)
protected void debug(java.lang.String fName, java.lang.String msg)