Class DependencyHandler
- 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.DependencyHandler
-
- All Implemented Interfaces:
DependencyTags,ContentHandler,IO,ContentHandler
public class DependencyHandler extends XMLReadHandlerImpl implements DependencyTags
Class for dependency specific implementation of xml handler.- Author:
- Rahol Kumar, Alexander Schultheis
-
-
Field Summary
-
Fields inherited from interface de.uni_trier.wi2.procake.data.io.xml.DependencyTags
ATT_GRAPH_ITEM_INFORMATION_REQUIRED, ATT_NAME, ATT_SOURCE, ATT_SOURCE_CASE, ATT_SOURCE_CASE_ITEM, ATT_SOURCE_CASE_ITEM_SEMANTIC_DESCRIPTOR, ATT_TARGET, ATT_TARGET_CASE, ATT_TARGET_CASE_ITEM, ATT_TARGET_CASE_ITEM_SEMANTIC_DESCRIPTOR, ATT_TYPE, ATT_VALUE, PREFIX_DEPENDENCY, SCHEMA_LOCATION_DEPENDENCY, TAG_DEPENDENCIES, TAG_DEPENDENCY, TAG_DEPENDENCY_MODEL, TAG_DEPENDENCY_SIMILARITIES, TAG_DEPENDENCY_SIMILARITY, TAG_DEPENDENCY_TYPE, TAG_DEPENDENCY_TYPES, URI_DEPENDENCY
-
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
-
-
Constructor Summary
Constructors Constructor Description DependencyHandler(WriteableObjectPool casebase, DependencyModel dependencyModel)Constructor for DependencyHandler.
-
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)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-)parametersvoidstartElement(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
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
-
-
-
-
Constructor Detail
-
DependencyHandler
public DependencyHandler(WriteableObjectPool casebase, DependencyModel dependencyModel)
Constructor for DependencyHandler.
- Parameters:
casebase- aWriteableObjectPoolobjectdependencyModel- aDependencyModelobject
-
-
Method Detail
-
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
-
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:
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Throws:
SAXException
-
characters
public void characters(char[] ch, int start, int length)Appends the given characters, at the given position, to the internal StringBuffer Appends the given characters, at the given position, to the internal StringBuffer. Here, only a description for dependency types is read and added to the objects.- Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classXMLReadHandlerImpl
-
endElement
public void endElement(String uri, String localName, String qName)
- Specified by:
endElementin interfaceContentHandler
-
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.
-
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.
-
-