Class MetaDataObjectSerializer_indent

java.lang.Object
org.apache.uima.resource.metadata.impl.MetaDataObjectSerializer_plain
org.apache.uima.resource.metadata.impl.MetaDataObjectSerializer_indent
All Implemented Interfaces:
MetaDataObject_impl.Serializer

class MetaDataObjectSerializer_indent extends MetaDataObjectSerializer_plain
  • Field Details

    • lineEnd

      private static String lineEnd
      Heuristics for comment and whitespace processing Example: Each element has 2 calls: startElement, endElement Surround these with: maybeOutputCommentsBefore maybeOutputCommentsAfter Detect top level (by fact that parent is null), and for top level: collect all above -%gt; output before startelement BUT, note that the sax parser doesn't do callbacks for text (blank lines) before the start element, so all we can collect are the comment lines. collect all below -%gt; output after endelement For normal element node, "start": --> output before element collect all prev white space siblings up to the one that contains the first newline because the prev white space siblings before and including that one will have been outputted as part of the previous start or end tag's "after element" processing if no nl assume comments go with previous element, and skip here (stop looking if get null for getPreviousSibling()) (stop looking if get other than comment or ignorable whitespace) (ignorable whitespace not always distinguishable from text that is whitespace?) --> output after element: if children: eg: collect all up to and including first nl before first Element child (stop at first Element node; if no nl, then the source had multiple elements on one line: associate the comments and whitespace with previous (and output them). if no children: - means it's written or Note: something not possible, because then it would have some text children output nothing - after comments will be done following endElement call For normal element node, "end": --> output before element collect all after last child Element; skip all up to first nl (assume before that, the comment goes with last child node) if no nl (e.g. ) assume comments go with previous element, and skip here (stop looking if get null for getNextSibling()) (stop looking if get Element) if no element children - output nothing --> output after element if this element has no successor sibling elements collect all up to the null else collect all up to and including first nl from getNextSibling(). (stop at first Element) For implied element nodes (no Java model object corresponding) We have only the "parent" node, and the element name. Try to do matching on the element name In this case, we always are working with the children in the Dom infoset; we have a last-outputted reference Scan from last-outputted, to find element match, and then use that element as the "root".
    • blanks

      private static final char[] blanks
    • nlca

      private static final char[] nlca
    • cc

  • Constructor Details

  • Method Details