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