Package org.eclnt.util.valuemgmt
Class XMLWriter
java.lang.Object
org.eclnt.util.valuemgmt.XMLWriter
Writes an XML content to a writer. There are two modes:
(1) Passing ComponentDump as null parameter: in this case the output is written into the writer. Just as expected.
(2) Passing the ComponentDUmp: in this case the output is written into the component dump, which itself maintains a hierarchy of XMLNode objects. Background: the PAGEADDON component at the end sends the XMLNode hierarchy to the XMLWriter. It does certain optimizations hers, e.g. areas in which there is no change of data are only transferred to be "not changed" - without sending all the contained components of the areas.
It is crucial that writing components in case of using ComponentDump must understand the principle of signalizing changes. Changes are to be registerrd in the following way:
(a) setting of attributes ==> implicitly the change is registered
(b) specifying new nodes to be new (c) explicitly calling the writer_writeChangedMarker method. This method e.g. needs to be called if any subcomponents of a components have been removed. See implementation of BaseComponent.
(1) Passing ComponentDump as null parameter: in this case the output is written into the writer. Just as expected.
(2) Passing the ComponentDUmp: in this case the output is written into the component dump, which itself maintains a hierarchy of XMLNode objects. Background: the PAGEADDON component at the end sends the XMLNode hierarchy to the XMLWriter. It does certain optimizations hers, e.g. areas in which there is no change of data are only transferred to be "not changed" - without sending all the contained components of the areas.
It is crucial that writing components in case of using ComponentDump must understand the principle of signalizing changes. Changes are to be registerrd in the following way:
(a) setting of attributes ==> implicitly the change is registered
(b) specifying new nodes to be new (c) explicitly calling the writer_writeChangedMarker method. This method e.g. needs to be called if any subcomponents of a components have been removed. See implementation of BaseComponent.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
writer_closeStartAndEndElement
(Writer writer, ComponentDump cd) static void
writer_closeStartElement
(Writer writer, ComponentDump cd) static void
static void
writer_endElement
(Writer writer, ComponentDump cd, String name) static void
writer_startElement
(Writer writer, ComponentDump cd, String name) static void
writer_startElement
(Writer writer, ComponentDump cd, String name, boolean isNewNode) static void
writer_writeAttribute
(Writer writer, ComponentDump cd, String name, Object value) static void
writer_writeAttributeWithFormattedValue
(Writer writer, ComponentDump cd, String name, Object value) static void
writer_writeChangedMarker
(Writer writer, ComponentDump cd) static void
writer_writeChangedMarkerForChildren
(Writer writer, ComponentDump cd) static void
writer_writeFormattedText
(Writer writer, ComponentDump cd, String value) The text that is passed as value is not updated in any way when getting wirtten into the output stream.static void
writer_writePreparedXML
(Writer writer, ComponentDump cd, String xml) static void
writer_writeText
(Writer writer, ComponentDump cd, String value)
-
Constructor Details
-
XMLWriter
public XMLWriter()
-
-
Method Details
-
writer_startElement
public static void writer_startElement(Writer writer, ComponentDump cd, String name) throws IOException - Throws:
IOException
-
writer_startElement
public static void writer_startElement(Writer writer, ComponentDump cd, String name, boolean isNewNode) throws IOException - Throws:
IOException
-
writer_closeStartElement
- Throws:
IOException
-
writer_closeStartElementWithoutLineFeed
public static void writer_closeStartElementWithoutLineFeed(Writer writer, ComponentDump cd) throws IOException - Throws:
IOException
-
writer_closeStartAndEndElement
public static void writer_closeStartAndEndElement(Writer writer, ComponentDump cd) throws IOException - Throws:
IOException
-
writer_writeAttribute
public static void writer_writeAttribute(Writer writer, ComponentDump cd, String name, Object value) throws IOException - Throws:
IOException
-
writer_writeAttributeWithFormattedValue
public static void writer_writeAttributeWithFormattedValue(Writer writer, ComponentDump cd, String name, Object value) throws IOException - Throws:
IOException
-
writer_writeText
public static void writer_writeText(Writer writer, ComponentDump cd, String value) throws IOException - Throws:
IOException
-
writer_writeFormattedText
public static void writer_writeFormattedText(Writer writer, ComponentDump cd, String value) throws IOException The text that is passed as value is not updated in any way when getting wirtten into the output stream. Use this text if you pass special sequences, like " ".- Throws:
IOException
-
writer_writeChangedMarker
-
writer_writeChangedMarkerForChildren
-
writer_endElement
public static void writer_endElement(Writer writer, ComponentDump cd, String name) throws IOException - Throws:
IOException
-
writer_writePreparedXML
public static void writer_writePreparedXML(Writer writer, ComponentDump cd, String xml) throws IOException - Throws:
IOException
-