Class SaxWalkerOverDom

java.lang.Object
org.apache.ws.commons.schema.docpath.SaxWalkerOverDom

public final class SaxWalkerOverDom extends Object
  • Field Details

  • Constructor Details

    • SaxWalkerOverDom

      public SaxWalkerOverDom()
      Constructs a new SaxWalkerOverDom.
    • SaxWalkerOverDom

      public SaxWalkerOverDom(ContentHandler contentHandler)
      Constructs a new SaxWalkerOverDom with the provided ContentHandler to send SAX events.
      Parameters:
      contentHandler - The content handler to send events to.
    • SaxWalkerOverDom

      public SaxWalkerOverDom(List<ContentHandler> contentHandlers)
      Constructs a new SaxWalkerOverDom, taking ownership of the list of ContentHandlers to send events to.
      Parameters:
      contentHandlers - The list of content handlers to send events to.
  • Method Details

    • addContentHandler

      public void addContentHandler(ContentHandler contentHandler)
      Adds the provided ContentHandler to the list of content handlers to send events to. If this content handler was already added, it will be sent events twice (or more often).
      Parameters:
      contentHandler - The content handler to send events to.
    • removeContentHandler

      public boolean removeContentHandler(ContentHandler contentHandler)
      Removes the first instance of the provided ContentHandler from the set of handlers to send events to. If the content handler was added more than once, it will continue to receive events.
      Parameters:
      contentHandler - The content handler to stop sending events to.
      Returns:
      true if it was found, false if not.
    • walk

      public void walk(Document document) throws SAXException
      Walks the provided Document, sending events to all of the ContentHandlers as it traverses. If there are no content handlers, this method is a no-op.
      Parameters:
      document - The Document to traverse.
      Throws:
      SAXException - if an exception occurs when notifying the handlers.
    • walk

      private void walk(Element element) throws SAXException
      Throws:
      SAXException
    • walk

      private void walk(Text text) throws SAXException
      Throws:
      SAXException
    • convertNullToEmptyString

      private static String convertNullToEmptyString(String input)
    • startPrefixMappings

      private List<String> startPrefixMappings(Node node) throws DOMException, SAXException
      Throws:
      DOMException
      SAXException