Class NetexParser

java.lang.Object
org.entur.netex.NetexParser

public class NetexParser extends Object
Main entry point to the library. Used to parse a NeTEx publication delivery into a queryable index.
  • Constructor Details

    • NetexParser

      public NetexParser()
      Create a default NetexParser. The default implementation relies on a SAX parser.
    • NetexParser

      public NetexParser(XmlStreamReaderFactory xmlStreamReaderFactory)
      Create a NeTexParser that parses a NeTEx document through an XML stream reader (StAX).
  • Method Details

    • parse

      public NetexEntitiesIndex parse(String pathToZip) throws IOException
      Parse a NeTEx publication delivery from one or more files in a zip archive
      Parameters:
      pathToZip - Path to zip file
      Returns:
      A queryable index of NeTEx entities
      Throws:
      IOException
    • parse

      public NetexEntitiesIndex parse(String pathToZip, NetexEntitiesIndex index) throws IOException
      Parse a NeTEx publication delivery from one or more files in a zip archive into an existing index. Existing entities with same id will be overwritten.
      Parameters:
      pathToZip - Path to zip file
      index - An instance of NetexEntitiesIndex
      Returns:
      The mutated index
      Throws:
      IOException
    • parse

      public NetexEntitiesIndex parse(InputStream inputStream)
      Parse an input stream of a single NeTEx public delivery
      Parameters:
      inputStream -
      Returns:
      A queryable index of NeTEx entities
    • parse

      public NetexEntitiesIndex parse(InputStream inputStream, NetexEntitiesIndex index)
      Parse an input stream of a single NeTEx publication delivery into an existing index Existing entities with same id will be overwritten.
      Parameters:
      inputStream - An InputStream
      index - An instance of NetexEntitiesIndex
      Returns:
      The mutated index