Class SimilarityModelParserImpl
- 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
-
- de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.SimilarityModelParserImpl
-
- All Implemented Interfaces:
SimilarityModelParser,IO,Reader
public class SimilarityModelParserImpl extends XMLReaderImpl implements SimilarityModelParser
SimilarityModelParserImpl class.
- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description static StringPARSER_NAMEConstantPARSER_NAME="SimilarityModelParser"-
Fields inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.XMLReaderImpl
filename, inputStream
-
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 SimilarityModelParserImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IOcopy()overwritten copy-method from Object; use it to copy a complete operatorStringgetDescription()A description of the io component.StringgetName()Each io component must have a name that is used inIOFactory.newIO(String).booleanisHandlerFor(Class value)Checks if the io component is capable to perform the operation for objects of this class.Objectread()Reads the give filename or input source and returns the parsed object.voidsetModelDependency(Model dataModel)The data model that belongs to this respective similarity model.voidsetTargetSimilarityModel(SimilarityModel simModel)This initializes the similarity model that is filled during the parsing process.-
Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.XMLReaderImpl
getFilename, getHandlerName, setFilename, setInputStream, 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 Detail
-
PARSER_NAME
public static final String PARSER_NAME
ConstantPARSER_NAME="SimilarityModelParser"- See Also:
- Constant Field Values
-
-
Method Detail
-
getDescription
public String getDescription()
A description of the io component. The description should contain the file format and the classes that can be managed.- Specified by:
getDescriptionin interfaceIO- Overrides:
getDescriptionin classIOImpl- Returns:
- a description of the io component
-
getName
public String getName()
Each io component must have a name that is used inIOFactory.newIO(String). The name must be unique thus it is usefull to use a short description or to the class name (this.getClass().getName()).
-
setTargetSimilarityModel
public void setTargetSimilarityModel(SimilarityModel simModel)
This initializes the similarity model that is filled during the parsing process. It can be a model that is initially empty or one that already contains measures (i.e., extension).- Specified by:
setTargetSimilarityModelin interfaceSimilarityModelParser- Parameters:
simModel- the model to fill
-
setModelDependency
public void setModelDependency(Model dataModel)
The data model that belongs to this respective similarity model.- Specified by:
setModelDependencyin interfaceSimilarityModelParser- Parameters:
dataModel- the data model
-
isHandlerFor
public boolean isHandlerFor(Class value)
Checks if the io component is capable to perform the operation for objects of this class.A typical implementation looks like:
public boolean isHandlerFor(Class value) { if (DataObject.class.isAssignableFrom(value)) return true; return false; }- Specified by:
isHandlerForin interfaceIO- Parameters:
value- The class that has to be checked.- Returns:
- Results
trueif the class can oeprate with the given class.
-
copy
public IO copy()
overwritten copy-method from Object; use it to copy a complete operator
-
read
public Object read() throws CakeIOException
Reads the give filename or input source and returns the parsed object.- Specified by:
readin interfaceReader- Overrides:
readin classXMLReaderImpl- Returns:
- Returns the parsed object.
- Throws:
CakeIOException
-
-