Class AbstractXMLHandler

All Implemented Interfaces:
IO, ContentHandler
Direct Known Subclasses:
AdaptationConfigHandler, DependencyHandler, ModelHandler, NESTGraphHandler, ObjectHandler, ObjectPoolHandler, SimilarityModelHandler, TrainingObjectPoolHandler, TransformationConfigHandler, WorkflowHandler

public abstract class AbstractXMLHandler extends IOImpl implements ContentHandler, IO
Base-class for all XML-handler-implementations.
Author:
Alexander Stromer
  • Constructor Details

    • AbstractXMLHandler

      public AbstractXMLHandler()
  • Method Details

    • getDocumentLocator

      public Locator getDocumentLocator()
    • setDocumentLocator

      public void setDocumentLocator(Locator documentLocator)
      Specified by:
      setDocumentLocator in interface ContentHandler
    • endDocument

      public void endDocument()
      Specified by:
      endDocument in interface ContentHandler
    • endPrefixMapping

      public void endPrefixMapping(String prefix)
      Specified by:
      endPrefixMapping in interface ContentHandler
    • ignorableWhitespace

      public void ignorableWhitespace(char[] ch, int start, int length)
      Specified by:
      ignorableWhitespace in interface ContentHandler
    • processingInstruction

      public void processingInstruction(String target, String data)
      Specified by:
      processingInstruction in interface ContentHandler
    • skippedEntity

      public void skippedEntity(String name)
      Specified by:
      skippedEntity in interface ContentHandler
    • startDocument

      public void startDocument()
      Specified by:
      startDocument in interface ContentHandler
    • startPrefixMapping

      public void startPrefixMapping(String prefix, String uri)
      Specified by:
      startPrefixMapping in interface ContentHandler
    • initiateSubHandler

      protected void initiateSubHandler(String uri, String localName, String qName, Attributes attributes) throws SAXException
      Calls the appropriate handler for the given (SAX-)parameters
      Parameters:
      uri - a String object
      localName - a String object
      qName - a String object
      attributes - a Attributes object
      Throws:
      SAXException
    • callSubHandlerStart

      protected boolean callSubHandlerStart(String uri, String localName, String qName, Attributes attributes) throws SAXException
      Tries to call a subHandler with the given (SAX-)parameters. If none is available, false is returned.
      Parameters:
      uri - a String object
      localName - a String object
      qName - a String object
      attributes - a Attributes object
      Returns:
      a boolean
      Throws:
      SAXException
    • callSubHandlerEnd

      protected boolean callSubHandlerEnd(String uri, String localName, String qName) throws SAXException
      Tries to call a subHandler with the given (SAX-)parameters. If none is available, false is returned.
      Parameters:
      uri - a String object
      localName - a String object
      qName - a String object
      Returns:
      a boolean
      Throws:
      SAXException
    • subHandlerFinishedWithObject

      public abstract void subHandlerFinishedWithObject(Object subHandlerObject)
    • notifyParentHandler

      protected void notifyParentHandler(Object subHandlerObject)
      Notifies the parentHandler about the fact, that the object finished importing, which the subHandler had to manage
      Parameters:
      subHandlerObject - the object, which was finished importing
    • setParentHandler

      public void setParentHandler(AbstractXMLHandler parentHandler)
    • characters

      public void characters(char[] ch, int start, int length)

      Appends the given characters, at the given position, to the internal StringBuffer

      Specified by:
      characters in interface ContentHandler
    • getCharacterString

      protected String getCharacterString()
      Gets the characterstream between the last open-tag and the last-closing tag. It does only make sense reading this variable at a closing-tag.
      Returns:
      a String object
    • getObject

      public abstract 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

      public abstract 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: