Class ModelHandler
- 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.XMLReadHandlerImpl
-
- de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.ModelHandler
-
- All Implemented Interfaces:
ModelIO,ModelTags,ContentHandler,IO,ContentHandler
public class ModelHandler extends XMLReadHandlerImpl implements ModelTags, ModelIO
ModelHandler class.
- Author:
- Rainer Maximini
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCOMPONENTConstantCOMPONENT="ModelIO.COMPONENT"protected PropertyTreeNodecurrentPropertyNodestatic StringHANDLERNAMEConstantHANDLERNAME="ModelHandler"-
Fields inherited from interface de.uni_trier.wi2.procake.utils.io.IO
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.data.io.ModelIO
COMPONENT_KEY, LOG_ATTRIBUTE_CLASS_NOT_FOUND, LOG_ATTRIBUTE_NAME_NOT_FOUND, LOG_CLASS_NOT_FOUND, LOG_ELEMENTCLASS_NOT_FOUND, LOG_NO_OPEN_OBJECT, LOG_NO_SUCH_ATTRIBUTE, LOG_SUPERCLASS_NOT_FOUND, LOG_UNEXPECTED_MODEL_FAILURE, LOG_UNKNOWN_ATTRIBUTE_VALUE_IN_SIM, LOG_UNKNOWN_OBJECT_CLASS, LOG_UNKNOWN_SAX_EXCEPTION, LOG_UNKNOWN_SIMILARITY_MEASURE, LOG_WRONG_ELEMENTCLASS
-
Fields inherited from interface de.uni_trier.wi2.procake.data.io.xml.ModelTags
ATT_ABSTRACT, ATT_CLASS, ATT_DEFAULT, ATT_DESCENDING, ATT_LOWERBOUND, ATT_MAXCARDINALITY, ATT_MAXSIZE, ATT_MIMETYPE, ATT_MINCARDINALITY, ATT_NAME, ATT_ONTOLOGY_NAME, ATT_ROOT_NODE_URI, ATT_SEMANTICDESCRIPTIONCLASS, ATT_SUPERCLASS, ATT_TYPE, ATT_UPPERBOUND, ATT_VALUE, PREFIX_CDM, SCHEMA_LOCATION_CDM, TAG_AGGREGATECLASS, TAG_ATTRIBUTE, TAG_BOOLEANCLASS, TAG_BYTEARRAYCLASS, TAG_DATECLASS, TAG_DOUBLECLASS, TAG_EDGE, TAG_ELEMENTCLASS, TAG_INSTANCEENUMERATIONPREDICATE, TAG_INSTANCEINTERVALPREDICATE, TAG_INSTANCEONTOLOGYORDERPREDICATE, TAG_INSTANCETAXONOMYORDERPREDICATE, TAG_INSTANCETOTALORDERPREDICATE, TAG_INTEGERCLASS, TAG_INTERVALCLASS, TAG_LISTCLASS, TAG_MODEL, TAG_NESTANDENDNODECLASS, TAG_NESTANDSTARTNODECLASS, TAG_NESTCONSTRAINTEDGECLASS, TAG_NESTCONTROLFLOWEDGECLASS, TAG_NESTDATAFLOWEDGECLASS, TAG_NESTDATANODECLASS, TAG_NESTEDGE, TAG_NESTGRAPHCLASS, TAG_NESTLOOPENDNODECLASS, TAG_NESTLOOPSTARTNODECLASS, TAG_NESTNODE, TAG_NESTORENDNODECLASS, TAG_NESTORSTARTNODECLASS, TAG_NESTPARTOFEDGECLASS, TAG_NESTSEQUENTIALWORKFLOWCLASS, TAG_NESTSUBWORKFLOWNODECLASS, TAG_NESTTASKNODECLASS, TAG_NESTWORKFLOWCLASS, TAG_NESTWORKFLOWNODECLASS, TAG_NESTXORENDNODECLASS, TAG_NESTXORSTARTNODECLASS, TAG_NODE, TAG_ONTOLOGYREF, TAG_PROPERTY, TAG_RELATION, TAG_SETCLASS, TAG_STRINGCLASS, TAG_TIMECLASS, TAG_TIMESTAMPCLASS, TAG_UNIONCLASS, TAG_URICLASS, TAG_VALUE, TAG_VOIDCLASS, URI_CDM
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedModelHandler()Constructor for ModelHandler.ModelHandler(Model model)Constructor for ModelHandler.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] ch, int start, int length)Appends the given characters, at the given position, to the internal StringBufferIOcopy()overwritten copy-method from Object; use it to copy a complete operatorvoidendElement(String uri, String localName, String qName)StringgetDescription()A description of the io component.StringgetName()Each io component must have a name that is used inIOFactory.newIO(String).ObjectgetObject()After parsing the document, this method must be called to get the Object.booleanisFinishElements()isFinishElements.booleanisHandlerFor(Class value)Checks if the io component is capable to perform the operation for objects of this class.booleanisHandlerFor(String uri, String localName, String qName, Attributes attributes)Queries the handler for possible handling of the given (SAX-)parametersvoidsetFinishElements(boolean finishElements)Setter for the fieldfinishElements.voidstartElement(String uri, String localName, String qName, Attributes attributes)voidsubHandlerFinishedWithObject(Object subHandlerObject)Callback-method from the subHandler to inform the parentHandler about the finished object-
Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.XMLReadHandlerImpl
callSubHandlerEnd, callSubHandlerStart, endDocument, endPrefixMapping, getCharacterString, getDocumentLocator, ignorableWhitespace, initiateSubHandler, notifyParentHandler, processingInstruction, resetSubHandler, setCharacterString, setDocumentLocator, setParentHandler, skippedEntity, startDocument, startPrefixMapping
-
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
-
HANDLERNAME
public static final String HANDLERNAME
ConstantHANDLERNAME="ModelHandler"- See Also:
- Constant Field Values
-
COMPONENT
protected static final String COMPONENT
ConstantCOMPONENT="ModelIO.COMPONENT"- See Also:
- Constant Field Values
-
currentPropertyNode
protected PropertyTreeNode currentPropertyNode
-
-
Method Detail
-
isHandlerFor
public boolean isHandlerFor(String uri, String localName, String qName, Attributes attributes)
Queries the handler for possible handling of the given (SAX-)parameters- Specified by:
isHandlerForin interfaceContentHandler- Returns:
-
characters
public void characters(char[] ch, int start, int length)Appends the given characters, at the given position, to the internal StringBuffer- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLReadHandlerImpl
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
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()).
-
getObject
public Object getObject()
After parsing the document, this method must be called to get the Object. This method can only be called once, because after calling the internal variables are resetted to reuse the object.- Specified by:
getObjectin interfaceContentHandler
-
isFinishElements
public boolean isFinishElements()
isFinishElements.
- Returns:
- a boolean
-
setFinishElements
public void setFinishElements(boolean finishElements)
Setter for the field
finishElements.- Parameters:
finishElements- a boolean
-
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
-
subHandlerFinishedWithObject
public void subHandlerFinishedWithObject(Object subHandlerObject)
Callback-method from the subHandler to inform the parentHandler about the finished object- Specified by:
subHandlerFinishedWithObjectin interfaceContentHandler- Specified by:
subHandlerFinishedWithObjectin classXMLReadHandlerImpl- Parameters:
subHandlerObject- The object created by the subHandler.
-
-