Class Visitor

java.lang.Object
de.unistuttgart.ims.uima.io.xml.Visitor
All Implemented Interfaces:
org.jsoup.select.NodeVisitor

public class Visitor
extends java.lang.Object
implements org.jsoup.select.NodeVisitor
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.util.Map<java.lang.String,​XMLElement> annotationMap
    Maps CSS selectors to XMLelements
    protected java.util.Map<org.jsoup.nodes.Node,​java.lang.Integer> beginMap
    Maps XML nodes to the character position where they start in the CAS
    protected java.lang.String[] blockElements
    An array of block elements.
    protected org.apache.uima.fit.factory.JCasBuilder builder  
    protected java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> ignoreFunction  
    protected boolean preserveWhitespace
    Whether to preserve the whitespace exactly as it is in the original.
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected Visitor​(org.apache.uima.jcas.JCas jcas)  
    protected Visitor​(org.apache.uima.jcas.JCas jcas, boolean preserveWhitespace)  
  • Method Summary

    Modifier and Type Method Description
    protected java.util.Map<java.lang.String,​XMLElement> getAnnotationMap()  
    protected java.lang.String[] getBlockElements()  
    protected java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> getIgnoreFunction()  
    protected org.apache.uima.jcas.JCas getJCas()  
    void head​(org.jsoup.nodes.Node node, int depth)  
    protected void setBlockElements​(java.lang.String[] blockElements)  
    protected void setIgnoreFunction​(java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> ignoreFunction)  
    void tail​(org.jsoup.nodes.Node node, int depth)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • builder

      protected org.apache.uima.fit.factory.JCasBuilder builder
    • beginMap

      protected java.util.Map<org.jsoup.nodes.Node,​java.lang.Integer> beginMap
      Maps XML nodes to the character position where they start in the CAS
    • annotationMap

      protected java.util.Map<java.lang.String,​XMLElement> annotationMap
      Maps CSS selectors to XMLelements
    • blockElements

      protected java.lang.String[] blockElements
      An array of block elements. If preserveWhitespace is not true, newline characters are introduced at the end of each block element
    • preserveWhitespace

      protected boolean preserveWhitespace
      Whether to preserve the whitespace exactly as it is in the original. This is needed for the XML->CAS->XML roundtrip. Defaults to false.
    • ignoreFunction

      protected java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> ignoreFunction
  • Constructor Details

    • Visitor

      protected Visitor​(org.apache.uima.jcas.JCas jcas)
    • Visitor

      protected Visitor​(org.apache.uima.jcas.JCas jcas, boolean preserveWhitespace)
  • Method Details

    • head

      public void head​(org.jsoup.nodes.Node node, int depth)
      Specified by:
      head in interface org.jsoup.select.NodeVisitor
    • tail

      public void tail​(org.jsoup.nodes.Node node, int depth)
      Specified by:
      tail in interface org.jsoup.select.NodeVisitor
    • getJCas

      protected org.apache.uima.jcas.JCas getJCas()
    • getAnnotationMap

      protected java.util.Map<java.lang.String,​XMLElement> getAnnotationMap()
    • getBlockElements

      protected java.lang.String[] getBlockElements()
    • setBlockElements

      protected void setBlockElements​(java.lang.String[] blockElements)
    • getIgnoreFunction

      protected java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> getIgnoreFunction()
    • setIgnoreFunction

      protected void setIgnoreFunction​(java.util.function.Function<org.jsoup.nodes.Element,​java.lang.Boolean> ignoreFunction)