Class SavotStaxParser

java.lang.Object
cds.savot.stax.SavotStaxParser
All Implemented Interfaces:
Markups

public final class SavotStaxParser extends Object implements Markups

It has been tested with Java 1.6 Stax implementation but it is possible to use other Stax implementations

Designed to use with JSR-173 compliant (Streaming API for XML)

remark L. Bourgès : equalsIgnoreCase() vs() equals as XML is case sensitive and VOTable specification says that clearly

Author:
Andre Schaaff
  • Field Details

    • FULL

      public static final int FULL
      FULL parsing mode: deprecated and replaced by FULLREAD
      See Also:
    • FULLREAD

      public static final int FULLREAD
      FULLREAD parsing mode: all in memory
      See Also:
    • SEQUENTIAL

      public static final int SEQUENTIAL
      SEQUENTIAL parsing mode: deprecated and replaced by RESOURCEREAD
      See Also:
    • RESOURCEREAD

      public static final int RESOURCEREAD
      RESOURCEREAD parsing mode: resource per resource reading
      See Also:
    • ROWREAD

      public static final int ROWREAD
      ROWREAD parsing mode: row per row reading
      See Also:
    • DEFAULT_STACK_CAPACITY

      public static final int DEFAULT_STACK_CAPACITY
      default stack capacity = 4 slots
      See Also:
  • Constructor Details

  • Method Details

    • close

      public void close()
      Close the input stream if still opened and free the internal parser
    • reset

      public void reset()
      Reset of the engine before another parsing LBO: useless methods ?
    • parse

      public void parse(int parsingType) throws IOException, XMLStreamException
      Parsing engine
      Parameters:
      parsingType - FULLREAD (all in memory), RESOURCEREAD (per RESOURCE) or ROWREAD (per ROW, for small memory size applications)
      Throws:
      IOException
      XMLStreamException
    • getNextResource

      public SavotResource getNextResource()
      Get the next Resource (warning : RESOURCEREAD mode only)
      Returns:
      a SavotResource (always NULL if other mode)
    • getNextTR

      public SavotTR getNextTR()
      Get the next TR (warning : ROWREAD mode only)
      Returns:
      a SavotTR (always NULL if other mode)
    • getVOTable

      public SavotVOTable getVOTable()
      Get a reference to V0TABLE object
      Returns:
      SavotVOTable
    • getResourceCount

      public int getResourceCount()
      Get the number of RESOURCE elements in the document (for statistics)
      Returns:
      a long value
    • getTableCount

      public int getTableCount()
      Get the number of TABLE elements in the document (for statistics)
      Returns:
      a long value
    • getTRCount

      public int getTRCount()
      Get the number of TR elements in the document (for statistics)
      Returns:
      a long value
    • getDataCount

      public int getDataCount()
      Get the number of DATA elements in the document (for statistics)
      Returns:
      a long value
    • getIdRefLinks

      public Map<String,Object> getIdRefLinks()
      Get a reference on the Hashtable containing the link between ID and ref
      Returns:
      a refernce to the Hashtable
    • getResourceFromRef

      public SavotResource getResourceFromRef(String ref)
      Search a RESOURCE corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      a reference to a SavotResource object
    • getFieldFromRef

      public SavotField getFieldFromRef(String ref)
      Search a FIELD corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotField
    • getFieldRefFromRef

      public SavotFieldRef getFieldRefFromRef(String ref)
      Search a FIELDref corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotFieldRef
    • getParamFromRef

      public SavotParam getParamFromRef(String ref)
      Search a PARAM corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotParam
    • getParamRefFromRef

      public SavotParamRef getParamRefFromRef(String ref)
      Search a PARAMref corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotParamRef
    • getTableFromRef

      public SavotTable getTableFromRef(String ref)
      Search a TABLE corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotTable
    • getGroupFromRef

      public SavotGroup getGroupFromRef(String ref)
      Search a GROUP corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotGROUP
    • getInfoFromRef

      public SavotInfo getInfoFromRef(String ref)
      Search a RESOURCE corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotInfo
    • getValuesFromRef

      public SavotValues getValuesFromRef(String ref)
      Search a VALUES corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotValues
    • getLinkFromRef

      public SavotLink getLinkFromRef(String ref)
      Search a LINK corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotLink
    • getCoosysFromRef

      public SavotCoosys getCoosysFromRef(String ref)
      Search a COOSYS corresponding to an ID ref
      Parameters:
      ref -
      Returns:
      SavotCoosys
    • getAllResources

      public SavotVOTable getAllResources()
      Get current VOTable (all resources)
      Returns:
      SavotVOTable
    • enableDebug

      public void enableDebug(boolean debug)
      Enable debug mode
      Parameters:
      debug - boolean
    • getStatistics

      public SavotStatistics getStatistics()
      Returns the statistics
      Returns:
      statistics
    • getVersion

      public String getVersion()
      Get Parser Version
      Returns:
      String
    • sequentialTester

      public void sequentialTester()
      For test only
    • main

      public static void main(String[] argv) throws Exception
      Main
      Parameters:
      argv -
      Throws:
      Exception