Interface Reader
-
- All Superinterfaces:
IO
- All Known Subinterfaces:
DependencyParser
- All Known Implementing Classes:
AdaptationConfigParser,DependencyParserImpl,Deserializer,ModelParserImpl,NESTGraphParser,NESTSequentialWorkflowParser,NESTWorkflowParser,ObjectParser,ObjectPoolParser,PrologGraphParser,SimilarityModelParserImpl,StringReader,TrainingObjectPoolParser,TransformationConfigReaderImpl,XMLReaderImpl
public interface Reader extends IO
The Reader interface provides some common constants and methods for all io readers. The usage of a reader is quite simple:Reader reader = (Reader) IOFactory.newIO("..."); // change reader name reader.setFilename("..."); // or reader.setInputSource(is); Object model = reader.read();The Reader has to guarantee that the object that is returned by
read()can be casted to the object for thatIO.isHandlerFor(Class)istrue.- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMPONENTComponent: "cake.io" (LogComponentIdentifier.COMPONENT)static StringCOMPONENT_KEYComponent-Key: "01" (LogComponentIdentifier.COMPONENT_KEY_IOREADER)static StringLOG_ENTITY_NOT_FOUNDThe entity with the specified ID could not be found.static StringLOG_MISSING_ATTRIBUTE_IN_TAGAttribute missing in tag.static StringLOG_NO_READER_FOUNDNo reader found for specified class.static StringLOG_SAX_EXCEPTIONUnknown tag encountered.static StringLOG_UNKNOWN_ATTRIBUTE_IN_TAGUnknown attribute found in tag.static StringLOG_UNKNOWN_TAGUnknown tag encountered.-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
DEFAULT_ENCODING, LOG_CONTENTHANDLER_NOT_FOUND, LOG_FILE_NOT_FOUND, LOG_IO_EXCEPTION, LOG_READER_NOT_FOUND, LOG_UNKNOWN_PARAMETER, LOG_WRITER_NOT_FOUND, LOG_WRONG_PARAMATER_TYPE, RESOURCE_XML
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.-
Methods inherited from interface de.uni_trier.wi2.procake.utils.io.IO
copy, getDescription, getFamily, getName, isHandlerFor, setFamily
-
-
-
-
Field Detail
-
COMPONENT
static final String COMPONENT
Component: "cake.io" (LogComponentIdentifier.COMPONENT)- See Also:
- Constant Field Values
-
COMPONENT_KEY
static final String COMPONENT_KEY
Component-Key: "01" (LogComponentIdentifier.COMPONENT_KEY_IOREADER)- See Also:
- Constant Field Values
-
LOG_ENTITY_NOT_FOUND
static final String LOG_ENTITY_NOT_FOUND
The entity with the specified ID could not be found.- Component:
COMPONENT - Key: "0100"
- ID
- See Also:
- Constant Field Values
- Component:
-
LOG_MISSING_ATTRIBUTE_IN_TAG
static final String LOG_MISSING_ATTRIBUTE_IN_TAG
Attribute missing in tag.- Component:
COMPONENT - Key: "0102"
- Attribute
- Tag
- See Also:
- Constant Field Values
- Component:
-
LOG_NO_READER_FOUND
static final String LOG_NO_READER_FOUND
No reader found for specified class.- Component:
COMPONENT - Key: "0104"
- this
- Class
- See Also:
- Constant Field Values
- Component:
-
LOG_SAX_EXCEPTION
static final String LOG_SAX_EXCEPTION
Unknown tag encountered.- Component:
COMPONENT - Key: "0105"
- this
- description
- uri
- line number
- column number
- See Also:
- Constant Field Values
- Component:
-
LOG_UNKNOWN_ATTRIBUTE_IN_TAG
static final String LOG_UNKNOWN_ATTRIBUTE_IN_TAG
Unknown attribute found in tag.- Component:
COMPONENT - Key: "0103"
- Attribute
- Tag
- See Also:
- Constant Field Values
- Component:
-
LOG_UNKNOWN_TAG
static final String LOG_UNKNOWN_TAG
Unknown tag encountered.- Component:
COMPONENT - Key: "0101"
- this
- Tag
- See Also:
- Constant Field Values
- Component:
-
-
Method Detail
-
read
Object read() throws CakeIOException
Reads the give filename or input source and returns the parsed object.- Returns:
- Returns the parsed object.
- Throws:
CakeIOException
-
setFilename
void setFilename(String filename)
Each reader must be able to read a file from a specified path.- Parameters:
filename- The filename that should be read.
-
setInputStream
void setInputStream(InputStream inputStream)
Each reader must be able to read from an input stream.- Parameters:
inputStream- Thethat should be read.
-
-