Interface GPEProviderManager


public interface GPEProviderManager
Author:
Jorge Piera
  • Method Details

    • addGpeParser

      void addGpeParser(String name, String description, Class clazz) throws ParserNotRegisteredException
      Adds a new GPE parser
      Parameters:
      name - Driver name. It must be written like FORMAT VERSION
      description - Driver description. Just a descriptive text
      clazz - The parser class
    • addGpeParser

      void addGpeParser(Class clazz) throws ParserNotRegisteredException
      Adds a new GPE parser
      Parameters:
      clazz - The parser class
    • addParsersFile

      void addParsersFile(File file) throws FileNotFoundException, IOException
      It loads the parsers of a parsers file. The file is a properties file. Every line has the structure: Parser=Parser class
      Parameters:
      file - File that contains the parsers list
      Throws:
      IOException
      FileNotFoundException
      ParserNotRegisteredException
    • addWritersFile

      void addWritersFile(File file) throws FileNotFoundException, IOException
      It loads the writers of a writers file. The file is a properties file. Every line has the structure: Writer=Parser class
      Parameters:
      file - File that contains the writers list
      Throws:
      IOException
      FileNotFoundException
    • getAllParsers

      IGPEParser[] getAllParsers()
      Returns:
      all the registered parsers
    • addGpeWriterHandlerImplementor

      void addGpeWriterHandlerImplementor(String name, String description, Class clazz) throws WriterHandlerNotRegisteredException
      Adds a new GPEWriterHandlerImplementor
      Parameters:
      name - Driver name. It must be written like FORMAT VERSION
      description - Driver description. Just a descriptive text
      clazz - The parser class
    • addGpeWriterHandlerImplementor

      void addGpeWriterHandlerImplementor(Class clazz) throws WriterHandlerNotRegisteredException
      Adds a new GPEWriterHandlerImplementor
      Parameters:
      clazz - The parser class
    • createParser

      IGPEParser createParser(String name) throws ParserCreationException
      Create a new parser from a name
      Parameters:
      name - GPEParser name
      contenHandler - Application contenHandler usett to throw the parsing events
      errorHandler - Application errror handler used to put errors and warnings
    • createParserByClass

      IGPEParser createParserByClass(String prefferredImplClassName) throws ParserCreationException
      Create a new parser from a name
      Parameters:
      name - GPEParser name
      contenHandler - Application contenHandler usett to throw the parsing events
      errorHandler - Application errror handler used to put errors and warnings
    • createParserByMimeType

      IGPEParser createParserByMimeType(String mimeType) throws ParserCreationException
      Create a new parser from a mime type. Each parser has a method named
      invalid reference
      GPEParser#getFormat()
      that returns the mimetype that the parser can read. One parser only supports one mimetype.

      This method retrieve all the parsers and returns the first parser that is able to read the mimetype. If there are more parsers that can open the file will not be used.

      Parameters:
      mimeType - The mimetype of the file to open
      Returns:
      A parser that can parse the mimetype.
      Throws:
      ParserCreationException - If it is not possible to create a parser
      See Also:
    • createParser

      IGPEParser createParser(URI uri) throws ParserCreationException
      Gets the parser that can open the file (if it exists)
      Parameters:
      uri - File to open
      Returns:
      Null if the driver doesn't exist
    • createParser

      IGPEParser createParser(File file) throws ParserCreationException
      Gets the parser that can open the file (if it exists)
      Parameters:
      file - File to open
      Returns:
      Null if the driver doesn't exist
    • createWriterHandlerImplementor

      IGPEWriterHandlerImplementor createWriterHandlerImplementor(String name) throws WriterHandlerCreationException
      Create a new content writer from a name
      Parameters:
      name - GPEWriterHandler name GPEParser name
      contenHandler - Application contenHandler usett to throw the parsing events
      errorHandler - Application errror handler used to put errors and warnings
    • createWriterHandlerImplementorByClass

      IGPEWriterHandlerImplementor createWriterHandlerImplementorByClass(String prefferredImplClassName) throws WriterHandlerCreationException
      Create a new writer from a class name. This method can be used if the class name is known but, the common method to get a writer is using the mime type. *
      Parameters:
      prefferredImplClassName - The name of the class that implements
      invalid reference
      GPEWriterHandler
      Returns:
      A writer for a concrete format.
      Throws:
      WriterHandlerCreationException - If it is not possible to create a writer
    • createWriterHandlerImplementorByMimeType

      IGPEWriterHandlerImplementor createWriterHandlerImplementorByMimeType(String mimeType) throws WriterHandlerCreationException
      Create a new writer from a mime type. Each writer has a method named
      invalid reference
      GPEWriterHandler#getFormat()
      that returns the mimetype that the writer can write. One writer only supports one mimetype.

      This method retrieve all the writers and returns the first one that is able to write the mimetype. If there are more writer that can write the format will not be used.

      Parameters:
      mimeType - The mimetype of the file to write
      Returns:
      A writer that can write the mimetype.
      Throws:
      WriterHandlerCreationException - If it is not possible to create a writer
      See Also:
    • getWriterHandlerByFormat

      ArrayList getWriterHandlerByFormat(String format)
      Gets all the writers that can write the provided format. The elements are of type IGPEWriterHandler
      Parameters:
      format - as a short form (without version). Example: "gml", "kml"
      Returns:
    • accept

      boolean accept(URI uri)
      Return true if exists a driver that can open the file
      Parameters:
      uri - File to open
      Returns:
      true if the driver exists