Interface DocViewParserHandler


public interface DocViewParserHandler
Handler to be used with DocViewParser.
  • Method Details

    • startDocViewNode

      void startDocViewNode(@NotNull @NotNull String nodePath, @NotNull @NotNull DocViewNode2 docViewNode, @NotNull @NotNull Optional<DocViewNode2> parentDocViewNode, int line, int column) throws IOException, RepositoryException
      Called for each element in the docview xml representing a node
      Parameters:
      nodePath - the absolute node path of the node, the last part of the path is the JCR qualified name of the docViewNode's name.
      docViewNode - the deserialized node (incl. its properties)
      parentDocViewNode - the parent deserialized node (only present if docViewNode is not the root node in the docview xml)
      line - the current line number in the docview xml
      column - the current column number in the docview xml
      Throws:
      IOException
      RepositoryException
    • endDocViewNode

      void endDocViewNode(@NotNull @NotNull String nodePath, @NotNull @NotNull DocViewNode2 docViewNode, @NotNull @NotNull Optional<DocViewNode2> parentDocViewNode, int line, int column) throws IOException, RepositoryException
      Called at the end of each element in the docview xml representing a node. At this point in time all child nodes have been processed.
      Parameters:
      nodePath - the absolute node path of the node
      docViewNode - the deserialized node (incl. its properties)
      parentDocViewNode - the parent deserialized node (only present if docViewNode is not the root node in the docview xml)
      line - the current line number in the docview xml
      column - the current column number in the docview xml
      Throws:
      IOException
      RepositoryException
    • endDocument

      default void endDocument() throws RepositoryException, IOException
      Called once when the end of a docview file has been reached.
      Throws:
      RepositoryException
      IOException
    • startPrefixMapping

      default void startPrefixMapping(@NotNull @NotNull String prefix, @NotNull @NotNull String uri)
      Called when a namespace mapping is defined in the docview xml. Rather use setNameResolver(NameResolver) instead if you just need to resolve JCR names.
      Parameters:
      prefix - the namespace prefix
      uri - the namespace uri
    • endPrefixMapping

      default void endPrefixMapping(@NotNull @NotNull String prefix)
      Called when a namespace mapping end in the docview xml. Rather use setNameResolver(NameResolver) instead if you just need to resolve JCR names.
      Parameters:
      prefix - the namespace prefix
    • setNameResolver

      default void setNameResolver(@NotNull @NotNull NameResolver nameResolver)
      Called before the first startDocViewNode(String, DocViewNode2, Optional, int, int) is called. Provides a NameResolver which can be used to resolve JCR names to their qualified form. Can be used instead of overwriting startPrefixMapping(String, String) and endPrefixMapping(String).
      Parameters:
      nameResolver - the resolver aware of all namespaces and their prefixes defined in the underlying XML document.
    • afterCharacterData

      default void afterCharacterData(@NotNull @NotNull String value, @NotNull @NotNull String nodePath, int line, int column)
      Called when non-whitespace character data is encountered in the underlying XML document. For DocView XML files character data is not considered, i.e. this method is only called for superfluous data.
      Parameters:
      value - the character data
      nodePath - the absolute node path of the node in which the character data was found
      line -
      column -