Class XMLReaderImpl
- 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.XMLReaderImpl
-
- Direct Known Subclasses:
AdaptationConfigParser,DependencyParserImpl,ModelParserImpl,NESTGraphParser,ObjectParser,ObjectPoolParser,SimilarityModelParserImpl,TrainingObjectPoolParser,TransformationConfigReaderImpl
public abstract class XMLReaderImpl extends IOImpl implements Reader
Base class for all XML-reader-implementations.- Author:
- Alexander Stromer
-
-
Field Summary
Fields Modifier and Type Field Description protected StringfilenameThe filename/filepath which should be used to read from.protected InputStreaminputStreamThe internal reader-object used for reading data.-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
COMPONENT, COMPONENT_KEY, DEFAULT_ENCODING, LOG_CONTENTHANDLER_NOT_FOUND, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_PARAMETER, LOG_WRITER_NOT_FOUND, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.Reader
COMPONENT, COMPONENT_KEY, LOG_ENTITY_NOT_FOUND, LOG_MISSING_ATTRIBUTE_IN_TAG, LOG_NO_READER_FOUND, LOG_SAX_EXCEPTION, LOG_UNKNOWN_ATTRIBUTE_IN_TAG, LOG_UNKNOWN_TAG
-
-
Constructor Summary
Constructors Constructor Description XMLReaderImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetFilename()Returns the name of the file, which was set to be read.StringgetHandlerName()getHandlerName.Objectread()Reads the give filename or input source and returns the parsed object.voidsetFilename(String filename)Each reader must be able to read a file from a specified path.voidsetInputStream(InputStream inputStream)Each reader must be able to read from an input stream.StringtoString()-
Methods inherited from class de.uni_trier.wi2.procake.data.io.IOImpl
getDescription, getFamily, getParameters, postInit, preInit, setFamily
-
Methods inherited from class de.uni_trier.wi2.procake.utils.composition.FactoryObjectImplementation
getParameter, initParametersBasedOn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.utils.io.IO
copy, getDescription, getFamily, getName, isHandlerFor, setFamily
-
-
-
-
Field Detail
-
filename
protected String filename
The filename/filepath which should be used to read from.
-
inputStream
protected InputStream inputStream
The internal reader-object used for reading data.
-
-
Method Detail
-
getFilename
public String getFilename()
Returns the name of the file, which was set to be read.- Returns:
- The name of the file.
-
setFilename
public void setFilename(String filename)
Each reader must be able to read a file from a specified path.- Specified by:
setFilenamein interfaceReader- Parameters:
filename- The filename that should be read.
-
setInputStream
public void setInputStream(InputStream inputStream)
Each reader must be able to read from an input stream.- Specified by:
setInputStreamin interfaceReader- Parameters:
inputStream- Thethat should be read.
-
read
public Object read() throws CakeIOException
Reads the give filename or input source and returns the parsed object.- Specified by:
readin interfaceReader- Returns:
- Returns the parsed object.
- Throws:
CakeIOException
-
-