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.XMLReadHandlerImpl
-
- de.uni_trier.wi2.procake.data.io.xml.xerces_saxImpl.NESTGraphHandler
-
- All Implemented Interfaces:
NESTGraphTags,ContentHandler,IO,ContentHandler
- Direct Known Subclasses:
NESTAbstractWorkflowHandler
public class NESTGraphHandler extends XMLReadHandlerImpl implements NESTGraphTags
Effective SAX-Handler-class. Is able to parse the content of NESTGraph-XML-files.- Author:
- Alexander Schultheis
-
-
Field Summary
Fields Modifier and Type Field Description protected NESTGraphObjectcurrentGraphreference to the NESTGraph, which gets read at the momentprotected NESTGraphItemObjectcurrentGraphItemreference to the most recent GraphItem of a NESTGraphstatic StringHANDLERNAMEConstantHANDLERNAME="NESTGraphHandler"protected MessageFormattermfprovides CAKE-formatting for exception-messagesprotected Modelmodelprotected booleannestInstanceStartedprotected ObjectsubHandlerObject-
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.data.io.xml.NESTGraphTags
ATT_CLASS, ATT_ID, ATT_POST, ATT_PRE, ATT_REF_ID, PREFIX_NEST, SCHEMA_LOCATION_NEST, TAG_EDGE, TAG_EDGES, TAG_NESTGRAPH, TAG_NODE, TAG_NODES, URI_NEST, VAL_EDGE, VAL_NODE
-
-
Constructor Summary
Constructors Constructor Description NESTGraphHandler()Constructor for NESTGraphHandler.
-
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 operatorvoidendElement(String uri, String localName, String qName)End portalprotected voidendElementProperty()endElementProperty.protected voidendSemanticDescriptionElement()endSemanticDescriptionElement.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.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-)parametersprotected voidstartEdgeElement(Attributes attributes)startEdgeElement.voidstartElement(String uri, String localName, String qName, Attributes attributes)Start portalprotected voidstartElementProperty(Attributes attributes)startElementProperty.protected voidstartNodeElement(Attributes attributes)startNodeElement.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, characters, 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
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, toString, wait, wait, wait
-
Methods inherited from interface de.uni_trier.wi2.procake.utils.io.IO
getDescription, getFamily, setFamily
-
-
-
-
Field Detail
-
HANDLERNAME
public static final String HANDLERNAME
ConstantHANDLERNAME="NESTGraphHandler"- See Also:
- Constant Field Values
-
currentGraph
protected NESTGraphObject currentGraph
reference to the NESTGraph, which gets read at the moment
-
currentGraphItem
protected NESTGraphItemObject currentGraphItem
reference to the most recent GraphItem of a NESTGraph
-
mf
protected final MessageFormatter mf
provides CAKE-formatting for exception-messages
-
subHandlerObject
protected Object subHandlerObject
-
model
protected final Model model
-
nestInstanceStarted
protected boolean nestInstanceStarted
-
-
Method Detail
-
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
-
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:
-
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()).
-
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
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
Start portal- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
endElement
public void endElement(String uri, String localName, String qName) throws SAXException
End portal- Specified by:
endElementin interfaceContentHandler- Throws:
SAXException
-
startNodeElement
protected void startNodeElement(Attributes attributes) throws ClassNotFoundException, IllegalInstantiationException, InvalidTypeException, NoSuchAttributeException
startNodeElement.
- Parameters:
attributes- aAttributesobject- Throws:
ClassNotFoundException- if any.IllegalInstantiationException- if any.InvalidTypeException- if any.NoSuchAttributeException- if any.
-
startEdgeElement
protected void startEdgeElement(Attributes attributes) throws ClassNotFoundException
startEdgeElement.
- Parameters:
attributes- aAttributesobject- Throws:
ClassNotFoundException- if any.
-
endSemanticDescriptionElement
protected void endSemanticDescriptionElement() throws InvalidTypeExceptionendSemanticDescriptionElement.
- Throws:
InvalidTypeException- if any.
-
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.
-
startElementProperty
protected void startElementProperty(Attributes attributes)
startElementProperty.
- Parameters:
attributes- aAttributesobject
-
endElementProperty
protected void endElementProperty() throws SAXException, NoSuchAttributeExceptionendElementProperty.
- Throws:
SAXException- if any.NoSuchAttributeException- if any.
-
-