Package JsonFse

Class NodeString


  • public class NodeString
    extends NodeValue
    Represents a JSON String.
    Author:
    Friedemann Seebass
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String mString  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getAsString​(int columnOffset, boolean hasLabel)
      Delivers recursively a node and all of its children as a formatted string.
      java.lang.String getAsStrippedString()
      In JSON all strings are surrounded by quotation marks.
      • Methods inherited from class java.lang.Object

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

      • mString

        protected java.lang.String mString
    • Method Detail

      • getAsString

        public java.lang.String getAsString​(int columnOffset,
                                            boolean hasLabel)
        Description copied from class: Node
        Delivers recursively a node and all of its children as a formatted string. Child nodes and their elements are indented according to the following rules:
        • Each pair (of label and value) is in its own line.
        • Values containing sub elements (i. e. JSON objects and arrays) start in the same line as the label.
        • If they contain no or only one element they are written in the same line, following directly after the label.
        • If they contain more than one element the opening bracket is written into the same line as the label, but each element in its own line. The elements are indented further mTabWidth spaces. The closing bracket is written in its own line, but in the same column as the opening bracket.
        Overrides:
        getAsString in class Node
        Parameters:
        columnOffset - Number of spaces an element is indented.
        hasLabel - If true this node starts in a line with a label. The element must not be indented then but follows immediately after the label.
        Returns:
        Formatted string of the node and its childs.
      • getAsStrippedString

        public java.lang.String getAsStrippedString()
        In JSON all strings are surrounded by quotation marks. These are regularly superfluous for further processing. This method returns the string without these quotes.
        Overrides:
        getAsStrippedString in class Node
        Returns:
        The string without the leading and trailing quotes.