Class XmlSerializer
java.lang.Object
com._1c.g5.v8.dt.internal.compare.xml.XmlSerializer
- All Implemented Interfaces:
Closeable,AutoCloseable
StAX wrapper with write-back support.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidcloseBufferQueue(boolean needWrite) Turns off buffering.voidStarts buffering commands.voidWrites an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.voidWrites an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event.voidwriteProperty(String property) Writes a property to the output.voidwriteProperty(String propertyName, String serializedProperty) Writes a property to the output.voidwriteStartElement(String name) Writes a start tag to the output.voidwriteStartElement(String name, String propertyName, String propertyValue) Writes a start tag with the given attribute to the output.voidWrites a start tag with the given attribute to the output.
-
Constructor Details
-
XmlSerializer
public XmlSerializer(OutputStream outputStream) throws XMLStreamException, FactoryConfigurationError Constructs a new instance.- Parameters:
outputStream- the output stream to serialize to, cannot benull- Throws:
XMLStreamException- if failed to create the XML stream writerFactoryConfigurationError- if an instance of the XML output factory cannot be loaded
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
writeStartElement
Writes a start tag to the output. All writeStartElement methods open a new scope in the internal namespace context. Writing the corresponding EndElement causes the scope to be closed.- Parameters:
name- name of the tag, can't benull
-
writeStartElement
Writes a start tag with the given attribute to the output. All writeStartElement methods open a new scope in the internal namespace context. Writing the corresponding EndElement causes the scope to be closed.- Parameters:
name- name of the tag, can't benullproperties- pairs of the attribute (key - value), can't benull
-
writeStartElement
Writes a start tag with the given attribute to the output. All writeStartElement methods open a new scope in the internal namespace context. Writing the corresponding EndElement causes the scope to be closed.- Parameters:
name- name of the tag, can't benullproperties- pairs of the attribute (key - value), can't benull
-
writeProperty
Writes a property to the output.- Parameters:
property- value of the property
-
writeProperty
Writes a property to the output.- Parameters:
propertyName- name of the propertyproperty- value of the property
-
writeEndElement
public void writeEndElement()Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event. -
writeInlineEndElement
public void writeInlineEndElement()Writes an end tag to the output relying on the internal state of the writer to determine the prefix and local name of the event. Does not add new line after value. -
createBufferQueue
public void createBufferQueue()Starts buffering commands. Nothing writes to the output untilcloseBufferQueueis called -
closeBufferQueue
public void closeBufferQueue(boolean needWrite) Turns off buffering. Buffered commands will be released or cleaned depends on argument- Parameters:
needWrite- iftruereleased buffered commands
-