Class XMLMetadata.Parser

java.lang.Object
org.apache.sis.storage.geotiff.XMLMetadata.Parser
Enclosing class:
XMLMetadata

private static final class XMLMetadata.Parser extends Object
Parser of GDAL metadata.
  • Field Details

    • reader

      private final XMLEventReader reader
      The XML reader from which to get XML elements.
    • name

      private final QName name
      A qualified name with the "name" local part, used for searching attributes.
    • depth

      private int depth
      A value increased for each level of nested <Item> element.
    • metadata

      private final MetadataBuilder metadata
      Where to write metadata.
    • startTime

      private Instant startTime
      Temporary storage for metadata values that need a little processing.
    • endTime

      private Instant endTime
      Temporary storage for metadata values that need a little processing.
  • Constructor Details

    • Parser

      Parser(XMLEventReader reader, MetadataBuilder metadata)
      Creates a new reader.
      Parameters:
      reader - the source of XML elements.
      metadata - the target of metadata elements.
  • Method Details

    • root

      void root(StartElement start) throws XMLStreamException
      Parses a <GDALMetadata> element and its children. After this method returns, the reader is positioned after the closing </GDALMetadata> tag.
      Parameters:
      start - the <GDALMetadata> element.
      Throws:
      XMLStreamException
    • item

      private void item(StartElement start) throws XMLStreamException
      Parses a <Item> element and its children. After this method returns, the reader is positioned after the closing </Item> tag.
      Parameters:
      start - the <Item> element.
      Throws:
      XMLStreamException
    • flush

      void flush()
      Writes to MetadataBuilder all information that were pending parsing completion.