Class XmlDeserializer

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

public class XmlDeserializer extends Object implements Closeable
The merge settings deserializer. Works with XML files serialized by IMergeSettingsSerializerService#serialize().
  • Constructor Details

    • XmlDeserializer

      public XmlDeserializer(InputStream inputStream) throws XMLStreamException
      Creates deserializer instance.
      Parameters:
      inputStream - the stream containing the serialized xml.
      Throws:
      XMLStreamException - the file has an incorrect format.
  • Method Details

    • hasNext

      public boolean hasNext() throws XMLStreamException
      Check for the existence of unread elements of the xml file.
      Returns:
      true Check for the existence of unread elements of the xml file, false if the end of the file is reached.
      Throws:
      XMLStreamException - the file has an incorrect format.
    • next

      public XmlElement next() throws XMLStreamException
      Reading the next element of the xml file.
      Returns:
      The next element of the xml document is the corresponding tag, cannot be null. Precondition: the cursor has not reached the end of the file. Postcondition: the cursor is shifted to the next tag.
      Throws:
      XMLStreamException - the file has an incorrect format or reached end of file.
    • skipToTag

      public XmlElement skipToTag(String tag) throws XMLStreamException
      Moves the cursor to the tag specified by the input data.
      Returns:
      The xml element of the document corresponding to the specified tag, cannot be null. Precondition: the cursor has not reached the end of the file, input tag is present in the file. Postcondition: the cursor is shifted to the first position of the input tag.
      Throws:
      XMLStreamException - the file has an incorrect format or there is no input tag in the file.
    • close

      public void close()
      Closes the input stream associated with the file.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable