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 the ContentHandler of 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 IOFactory which is capable to manage ContentHandler as well as Readers and Writers.

The second requirement is realised in this interface which provides the additional method getObject() to get the parsed object.

Rainer Maximini
See Also:
  • Method Details

    • 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 the Locator object of the parser.
      The locate object.
      See Also:
    • 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
      uri -
      localName -
      qName -
      attributes -
    • setCharacterString

      void setCharacterString(String characters)
      Transfers the characterstring from the parentHandler to the subHandler (necessary, because all SAX-calls are carried via all parentHandlers)
      characters -
    • subHandlerFinishedWithObject

      void subHandlerFinishedWithObject(Object subHandlerObject)
      Callback-method from the subHandler to inform the parentHandler about the finished object
      subHandlerObject - The object created by the subHandler.
    • setParentHandler

      void setParentHandler(ContentHandler parentHandler)
      Sets the given Handler as parentHandler
      parentHandler -
    • resetSubHandler

      void resetSubHandler()
      Sets the Subhandler of this handler to empty → clears the usage of this subHandler