public class DefaultGPEProviderManager extends Object implements GPEProviderManager
Constructor and Description |
---|
DefaultGPEProviderManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(URI uri)
Return true if exists a driver that can open the file
|
void |
addGpeParser(Class clazz)
Adds a new GPE parser
|
void |
addGpeParser(String name,
String description,
Class clazz)
Adds a new GPE parser
|
void |
addGpeWriterHandlerImplementor(Class clazz)
Adds a new GPEWriterHandlerImplementor
|
void |
addGpeWriterHandlerImplementor(String name,
String description,
Class clazz)
Adds a new GPEWriterHandlerImplementor
|
void |
addParsersFile(File file)
It loads the parsers of a parsers file.
|
void |
addWritersFile(File file)
It loads the writers of a writers file.
|
IGPEParser |
createParser(File file)
Gets the parser that can open the file (if it exists)
|
IGPEParser |
createParser(String name)
Create a new parser from a name
|
IGPEParser |
createParser(URI uri)
Gets the parser that can open the file (if it exists)
|
IGPEParser |
createParserByClass(String prefferredImplClassName)
Create a new parser from a name
|
IGPEParser |
createParserByMimeType(String mimeType)
Create a new parser from a mime type.
|
IGPEWriterHandlerImplementor |
createWriterHandlerImplementor(String name)
Create a new content writer from a name
|
IGPEWriterHandlerImplementor |
createWriterHandlerImplementorByClass(String prefferredImplClassName)
Create a new writer from a class name.
|
IGPEWriterHandlerImplementor |
createWriterHandlerImplementorByMimeType(String mimeType)
Create a new writer from a mime type.
|
IGPEParser[] |
getAllParsers() |
ArrayList |
getWriterHandlerByFormat(String format)
Gets all the writers that can write the provided format.
|
public boolean accept(URI uri)
GPEProviderManager
accept
in interface GPEProviderManager
uri
- File to openpublic void addGpeParser(String name, String description, Class clazz) throws ParserNotRegisteredException
GPEProviderManager
addGpeParser
in interface GPEProviderManager
name
- Driver name. It must be written like FORMAT VERSIONdescription
- Driver description. Just a descriptive textclazz
- The parser classParserNotRegisteredException
public void addGpeParser(Class clazz) throws ParserNotRegisteredException
GPEProviderManager
addGpeParser
in interface GPEProviderManager
clazz
- The parser classParserNotRegisteredException
public void addGpeWriterHandlerImplementor(String name, String description, Class clazz) throws WriterHandlerNotRegisteredException
GPEProviderManager
addGpeWriterHandlerImplementor
in interface GPEProviderManager
name
- Driver name. It must be written like FORMAT VERSIONdescription
- Driver description. Just a descriptive textclazz
- The parser classWriterHandlerNotRegisteredException
public void addGpeWriterHandlerImplementor(Class clazz) throws WriterHandlerNotRegisteredException
GPEProviderManager
addGpeWriterHandlerImplementor
in interface GPEProviderManager
clazz
- The parser classWriterHandlerNotRegisteredException
public void addParsersFile(File file) throws FileNotFoundException, IOException
GPEProviderManager
addParsersFile
in interface GPEProviderManager
file
- File that contains the parsers listFileNotFoundException
IOException
public void addWritersFile(File file) throws FileNotFoundException, IOException
GPEProviderManager
addWritersFile
in interface GPEProviderManager
file
- File that contains the writers listFileNotFoundException
IOException
public IGPEParser createParser(String name) throws ParserCreationException
GPEProviderManager
createParser
in interface GPEProviderManager
name
- GPEParser nameParserCreationException
public IGPEParser createParser(URI uri) throws ParserCreationException
GPEProviderManager
createParser
in interface GPEProviderManager
uri
- File to openParserCreationException
public IGPEParser createParserByClass(String prefferredImplClassName) throws ParserCreationException
GPEProviderManager
createParserByClass
in interface GPEProviderManager
ParserCreationException
public IGPEParser createParserByMimeType(String mimeType) throws ParserCreationException
GPEProviderManager
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.
createParserByMimeType
in interface GPEProviderManager
mimeType
- The mimetype of the file to openParserCreationException
- If it is not possible to create a parserpublic IGPEWriterHandlerImplementor createWriterHandlerImplementor(String name) throws WriterHandlerCreationException
GPEProviderManager
createWriterHandlerImplementor
in interface GPEProviderManager
name
- GPEWriterHandler name
GPEParser nameWriterHandlerCreationException
public IGPEWriterHandlerImplementor createWriterHandlerImplementorByClass(String prefferredImplClassName) throws WriterHandlerCreationException
GPEProviderManager
createWriterHandlerImplementorByClass
in interface GPEProviderManager
prefferredImplClassName
- The name of the class that implements GPEWriterHandler
WriterHandlerCreationException
- If it is not possible to create a writerpublic IGPEWriterHandlerImplementor createWriterHandlerImplementorByMimeType(String mimeType) throws WriterHandlerCreationException
GPEProviderManager
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.
createWriterHandlerImplementorByMimeType
in interface GPEProviderManager
mimeType
- The mimetype of the file to writeWriterHandlerCreationException
- If it is not possible to create a writerpublic IGPEParser[] getAllParsers()
getAllParsers
in interface GPEProviderManager
public ArrayList getWriterHandlerByFormat(String format)
GPEProviderManager
getWriterHandlerByFormat
in interface GPEProviderManager
format
- as a short form (without version). Example: "gml", "kml"public IGPEParser createParser(File file) throws ParserCreationException
GPEProviderManager
createParser
in interface GPEProviderManager
file
- File to openParserCreationException