Package org.gvsig.gpe.lib.impl.parser
Class GPEParser
java.lang.Object
org.gvsig.gpe.lib.impl.parser.GPEParser
- All Implemented Interfaces:
IGPEParser
This class has to be inherited by all the classes that
implements a parser for a geographical format. IT has methods
to indicate the formats and the versions that is able to
parse.
- Author:
- Jorge Piera Llodrá (jorge.piera@iver.es), Carlos Sánchez Periñán (sanchez_carper@gva.es)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract booleanReturn if the driver can open the fileabstract booleanReturn if the driver can open the fileabstract Stringabstract StringReturn the format that the driver is able to readprotected InputStreamabstract StringgetName()voidparse(IGPEContentHandlerInmGeom contents, IGPEErrorHandler errors, InputStream is) Method to parse an InputStream.voidparse(IGPEContentHandlerInmGeom contents, IGPEErrorHandler errors, URI uri) Method to parse a file.protected abstract voidParses the file from an input streamprotected abstract voidparseURI()Parses the file from a URIvoidsetContentHandler(IGPEContentHandlerInmGeom contentHandler) voidsetErrorHandler(IGPEErrorHandler errorHandler) protected voidWe need to find a better way to reuse or coupling parsers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.gpe.lib.spi.parser.IGPEParser
getProjection
-
Constructor Details
-
GPEParser
public GPEParser()All the GPE parser must implement an empty constructor
-
-
Method Details
-
parse
Method to parse a file. It cannot to throw any exception and it cannot to return any value. In a future it could be implemented like a independent thread- Specified by:
parsein interfaceIGPEParser- Parameters:
contents- Application ContentHandlererrors- Application ErrorsHandleruri- File to open- Throws:
Exception
-
parseURI
protected abstract void parseURI()Parses the file from a URI -
parse
Method to parse an InputStream. It cannot to throw any exception and it cannot to return any value. In a future it could be implemented like a independent thread- Specified by:
parsein interfaceIGPEParser- Parameters:
contents- Application ContentHandlererrors- Application ErrorsHandleris- The input stream- Throws:
Exception
-
parseStream
protected abstract void parseStream()Parses the file from an input stream -
accept
Return if the driver can open the file- Specified by:
acceptin interfaceIGPEParser- Parameters:
uri- File to open- Returns:
- True if the driver is able to open it
-
accept
Return if the driver can open the file- Parameters:
uri- File to open- Returns:
- True if the driver is able to open it
-
getFormat
Return the format that the driver is able to read- Specified by:
getFormatin interfaceIGPEParser- Returns:
-
getContentHandler
- Specified by:
getContentHandlerin interfaceIGPEParser- Returns:
- the contentHandler
-
getErrorHandler
- Specified by:
getErrorHandlerin interfaceIGPEParser- Returns:
- the errorHandler
-
getMainFile
- Specified by:
getMainFilein interfaceIGPEParser- Returns:
- the file
-
getDescription
- Specified by:
getDescriptionin interfaceIGPEParser- Returns:
- the description
-
getName
- Specified by:
getNamein interfaceIGPEParser- Returns:
- the name
-
getInputStream
- Returns:
- the is
-
setInputStream
We need to find a better way to reuse or coupling parsers. This method was introduced for the SLD parsing to grab a single geometry from a filter.- Parameters:
is- the is to set
-
setErrorHandler
- Specified by:
setErrorHandlerin interfaceIGPEParser- Parameters:
errorHandler- the errorHandler to set
-
setContentHandler
- Specified by:
setContentHandlerin interfaceIGPEParser- Parameters:
contentHandler- the contentHandler to set
-
getGpeManager
- Returns:
- the gpeManager
-