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 TypeMethodDescriptionvoid
close()
void
closeBufferQueue
(boolean needWrite) Turns off buffering.void
Starts buffering commands.void
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.void
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.void
writeProperty
(String property) Writes a property to the output.void
writeProperty
(String propertyName, String serializedProperty) Writes a property to the output.void
writeStartElement
(String name) Writes a start tag to the output.void
writeStartElement
(String name, String propertyName, String propertyValue) Writes a start tag with the given attribute to the output.void
Writes 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:
close
in interfaceAutoCloseable
- Specified by:
close
in 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 benull
properties
- 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 benull
properties
- 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 untilcloseBufferQueue
is called -
closeBufferQueue
public void closeBufferQueue(boolean needWrite) Turns off buffering. Buffered commands will be released or cleaned depends on argument- Parameters:
needWrite
- iftrue
released buffered commands
-