Class XmlSerializer

java.lang.Object
com._1c.g5.v8.dt.internal.compare.xml.XmlSerializer
All Implemented Interfaces:
Closeable, AutoCloseable

public class XmlSerializer extends Object implements Closeable
StAX wrapper with write-back support.
  • Constructor Details

  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • writeStartElement

      public void writeStartElement(String name)
      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 be null
    • writeStartElement

      public void writeStartElement(String name, String propertyName, String propertyValue)
      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 be null
      properties - pairs of the attribute (key - value), can't be null
    • writeStartElement

      public void writeStartElement(String name, List<Pair<String,String>> properties)
      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 be null
      properties - pairs of the attribute (key - value), can't be null
    • writeProperty

      public void writeProperty(String propertyName, String serializedProperty)
      Writes a property to the output.
      Parameters:
      property - value of the property
    • writeProperty

      public void writeProperty(String property)
      Writes a property to the output.
      Parameters:
      propertyName - name of the property
      property - 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 until closeBufferQueue is called
    • closeBufferQueue

      public void closeBufferQueue(boolean needWrite)
      Turns off buffering. Buffered commands will be released or cleaned depends on argument
      Parameters:
      needWrite - if true released buffered commands