Class AbstractXMLReader
java.lang.Object
de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
de.uni_trier.wi2.procake.data.io.IOImpl
de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.AbstractXMLReader
- All Implemented Interfaces:
IO
,ProCAKEReader
- Direct Known Subclasses:
AdaptationConfigReader
,DependencyReader
,ModelReader
,NESTGraphReader
,ObjectPoolReader
,ObjectReader
,SimilarityModelReader
,TrainingObjectPoolReader
,TransformationConfigReaderImpl
Base class for all XML-reader-implementations.
- Author:
- Alexander Stromer
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
The filename/filepath which should be used to read from.protected InputStream
The internal reader-object used for reading data.Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
DEFAULT_ENCODING, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_PARAMETER, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.ProCAKEReader
LOG_ENTITY_NOT_FOUND, LOG_UNKNOWN_ATTRIBUTE_IN_TAG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the file, which was set to be read.protected abstract AbstractXMLHandler
Provides a handler by the subclass in order to be used to create the parser.read()
Reads the give filename or input source and returns the parsed object.void
setFilename
(String filename) Each reader must be able to read a file from a specified path.void
setInputStream
(InputStream inputStream) Each reader must be able to read from an input stream.toString()
Methods inherited from class de.uni_trier.wi2.procake.data.io.IOImpl
getFamily, getParameters, postInit, preInit, setFamily
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
-
Field Details
-
filename
The filename/filepath which should be used to read from. -
inputStream
The internal reader-object used for reading data.
-
-
Constructor Details
-
AbstractXMLReader
public AbstractXMLReader()
-
-
Method Details
-
getFilename
Returns the name of the file, which was set to be read.- Returns:
- The name of the file.
-
setFilename
Each reader must be able to read a file from a specified path.- Specified by:
setFilename
in interfaceProCAKEReader
- Parameters:
filename
- The filename that should be read.
-
setInputStream
Each reader must be able to read from an input stream.- Specified by:
setInputStream
in interfaceProCAKEReader
- Parameters:
inputStream
- Thethat should be read
.
-
toString
-
provideHandler
Provides a handler by the subclass in order to be used to create the parser. This should reduce code duplicates.- Returns:
- the provided content handler
-
read
Reads the give filename or input source and returns the parsed object.- Specified by:
read
in interfaceProCAKEReader
- Returns:
- Returns the parsed object.
- Throws:
CAKEIOException
-