Class NESTGraphHandler
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.AbstractXMLHandler
de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.NESTGraphHandler
- All Implemented Interfaces:
NESTGraphTags
,IO
,ContentHandler
- Direct Known Subclasses:
NESTAbstractWorkflowHandler
Effective SAX-Handler-class. Is able to parse the content of NESTGraph-XML-files.
- Author:
- Alexander Schultheis
-
Field Summary
Modifier and TypeFieldDescriptionprotected NESTGraphObject
reference to the NESTGraph, which gets read at the momentprotected NESTGraphItemObject
reference to the most recent GraphItem of a NESTGraphstatic final String
ConstantHANDLERNAME="NESTGraphHandler"
protected final Model
protected boolean
protected Object
provides CAKE-formatting for exception-messagesFields 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.data.io.xml.NESTGraphTags
ATT_CLASS, ATT_ID, ATT_POST, ATT_PRE, ATT_REF_ID, LOG_VALUE_FROM_ATTRIBUTE_IS_NULL, PREFIX_NEST, SCHEMA_LOCATION_NEST, TAG_EDGE, TAG_EDGES, TAG_NESTGRAPH, TAG_NESTSEQUENTIALWORKFLOW, TAG_NESTWORKFLOW, TAG_NODE, TAG_NODES, URI_NEST, VAL_EDGE, VAL_NODE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
overwritten copy-method from Object; use it to copy a complete operatorprotected void
createEdge
(Attributes attributes, NESTEdgeObject edge) void
endElement
(String uri, String localName, String qName) protected void
endElementProperty.protected void
endSemanticDescriptionElement.getName()
Each io component must have a name that is used inIOFactory.newIO(String)
.After parsing the document, this method must be called to get the Object.boolean
isHandlerFor
(Class value) Checks if the io component is capable to perform the operation for objects of this class.boolean
isHandlerFor
(String uri, String localName, String qName, Attributes attributes) Queries the handler for possible handling of the given (SAX-)parametersprotected void
startEdgeElement
(Attributes attributes) startEdgeElement.void
startElement
(String uri, String localName, String qName, Attributes attributes) protected void
startElementProperty
(Attributes attributes) startElementProperty.protected void
startNodeElement
(Attributes attributes) startNodeElement.void
subHandlerFinishedWithObject
(Object subHandlerObject) Methods inherited from class de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.AbstractXMLHandler
callSubHandlerEnd, callSubHandlerStart, characters, endDocument, endPrefixMapping, getCharacterString, getDocumentLocator, ignorableWhitespace, initiateSubHandler, notifyParentHandler, processingInstruction, 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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
HANDLER_NAME
ConstantHANDLERNAME="NESTGraphHandler"
- See Also:
-
currentGraph
reference to the NESTGraph, which gets read at the moment -
currentGraphItem
reference to the most recent GraphItem of a NESTGraph -
subHandlerObject
provides CAKE-formatting for exception-messages -
model
-
nestInstanceStarted
protected boolean nestInstanceStarted
-
-
Constructor Details
-
NESTGraphHandler
public NESTGraphHandler()Constructor for NESTGraphHandler.
-
-
Method Details
-
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:
getObject
in classAbstractXMLHandler
-
isHandlerFor
Queries the handler for possible handling of the given (SAX-)parameters- Specified by:
isHandlerFor
in classAbstractXMLHandler
- Returns:
-
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()
). -
isHandlerFor
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:
isHandlerFor
in interfaceIO
- Parameters:
value
- The class that has to be checked.- Returns:
- Results
true
if the class can oeprate with the given class.
-
copy
overwritten copy-method from Object; use it to copy a complete operator -
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Start portal
- Specified by:
startElement
in interfaceContentHandler
- Throws:
SAXException
-
endElement
End portal
- Specified by:
endElement
in interfaceContentHandler
- Throws:
SAXException
-
startNodeElement
protected void startNodeElement(Attributes attributes) throws ProCAKEClassNotFoundException, IllegalInstantiationException, ProCAKEInvalidTypeException, ProCAKENoSuchAttributeException startNodeElement.
- Parameters:
attributes
- aAttributes
object- Throws:
ProCAKEClassNotFoundException
- if any.IllegalInstantiationException
- if any.ProCAKEInvalidTypeException
- if any.ProCAKENoSuchAttributeException
- if any.
-
startEdgeElement
startEdgeElement.
- Parameters:
attributes
- aAttributes
object- Throws:
ProCAKEClassNotFoundException
- if any.
-
createEdge
-
endSemanticDescriptionElement
endSemanticDescriptionElement.
- Throws:
ProCAKEInvalidTypeException
- if any.
-
subHandlerFinishedWithObject
- Specified by:
subHandlerFinishedWithObject
in classAbstractXMLHandler
-
startElementProperty
startElementProperty.
- Parameters:
attributes
- aAttributes
object
-
endElementProperty
endElementProperty.
- Throws:
CAKESaxException
- if any.ProCAKENoSuchAttributeException
- if any.
-