Interface ContentHandler
-
- All Superinterfaces:
ContentHandler,IO
- All Known Implementing Classes:
AdaptationConfigHandler,DependencyHandler,ModelHandler,NESTAbstractWorkflowHandler,NESTGraphHandler,NESTSequentialWorkflowHandler,NESTWorkflowHandler,ObjectHandler,ObjectPoolHandler,SimilarityModelHandler,TrainingPoolHandler,TransformationConfigHandler,WorkflowHandler,XMLReadHandlerImpl
public interface ContentHandler extends ContentHandler, IO
The ContentHandler extends theContentHandlerof the SAX parser API with an additional unified method to get the parsed object. This is very important to reuse content handler in embedded XML files. For example, the CADP.XSD includes the CDOL.XSD in an own namespace. To reuse the content handler of CDOL it is necessary first to have access to the content handler and second to have a method to get the parsed object.The first requirement is realised in the
IOFactorywhich is capable to manage ContentHandler as well asReaders andWriters.The second requirement is realised in this interface which provides the additional method
getObject()to get the parsed object.- Author:
- Rainer Maximini
- See Also:
IOFactory.getContentHandlerNamesFor(Class)
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LocatorgetDocumentLocator()To generate usefull log messages it is very important to know the location of the exception or log information.ObjectgetObject()After parsing the document, this method must be called to get the Object.booleanisHandlerFor(String uri, String localName, String qName, Attributes attributes)Queries the handler for possible handling of the given (SAX-)parametersvoidresetSubHandler()Sets the Subhandler of this handler to empty → clears the usage of this subHandlervoidsetCharacterString(String characters)Transfers the characterstring from the parentHandler to the subHandler (necessary, because all SAX-calls are carried via all parentHandlers)voidsetParentHandler(ContentHandler parentHandler)Sets the given Handler as parentHandlervoidsubHandlerFinishedWithObject(Object subHandlerObject)Callback-method from the subHandler to inform the parentHandler about the finished object-
Methods inherited from interface org.xml.sax.ContentHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping
-
Methods inherited from interface de.uni_trier.wi2.procake.utils.io.IO
copy, getDescription, getFamily, getName, isHandlerFor, setFamily
-
-
-
-
Method Detail
-
getDocumentLocator
Locator getDocumentLocator()
To generate usefull log messages it is very important to know the location of the exception or log information. Therefore, each ContentHandler should provide theLocatorobject of the parser.- Returns:
- The locate object.
- See Also:
Locator
-
getObject
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.
-
isHandlerFor
boolean isHandlerFor(String uri, String localName, String qName, Attributes attributes)
Queries the handler for possible handling of the given (SAX-)parameters- Parameters:
uri-localName-qName-attributes-- Returns:
-
setCharacterString
void setCharacterString(String characters)
Transfers the characterstring from the parentHandler to the subHandler (necessary, because all SAX-calls are carried via all parentHandlers)- Parameters:
characters-
-
subHandlerFinishedWithObject
void subHandlerFinishedWithObject(Object subHandlerObject)
Callback-method from the subHandler to inform the parentHandler about the finished object- Parameters:
subHandlerObject- The object created by the subHandler.
-
setParentHandler
void setParentHandler(ContentHandler parentHandler)
Sets the given Handler as parentHandler- Parameters:
parentHandler-
-
resetSubHandler
void resetSubHandler()
Sets the Subhandler of this handler to empty → clears the usage of this subHandler
-
-