Class StringNode

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class StringNode
    extends LeafNode<java.lang.String>
    A StringNode class represents a string in a ConfigInstance.
    Author:
    larschr
    • Constructor Summary

      Constructors 
      Constructor Description
      StringNode()
      Creates a new un-initialized StringNode.
      StringNode​(java.lang.String value)
      Creates a new StringNode, initialized to value.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected boolean doSetValue​(java.lang.String value)
      Sets the value of this string from a the string representation of this value in the (escaped) input configuration.
      java.lang.String getValue()
      Subclasses must implement this, in compliance with the rules given in the return tag.
      java.lang.String toString()
      Subclasses must implement this, in compliance with the rules given in the return tag.
      static java.lang.String unescapeQuotedString​(java.lang.String string)
      Remove character escape codes.
      java.lang.String value()
      Returns the value of this string.
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • StringNode

        public StringNode()
        Creates a new un-initialized StringNode.
      • StringNode

        public StringNode​(java.lang.String value)
        Creates a new StringNode, initialized to value.
        Parameters:
        value - the value of this StringNode.
    • Method Detail

      • value

        public java.lang.String value()
        Returns the value of this string. Same as getValue() since the value of this node is a String (but implementations in other LeafNode sub-classes differ).
        Overrides:
        value in class LeafNode<java.lang.String>
        Returns:
        the string representation of this StringNode, or null if the vlaue is explicitly set to null
      • getValue

        public java.lang.String getValue()
        Description copied from class: LeafNode
        Subclasses must implement this, in compliance with the rules given in the return tag.
        Specified by:
        getValue in class LeafNode<java.lang.String>
        Returns:
        the String representation of the node value, or the 'null' object if the node value is null.
      • toString

        public java.lang.String toString()
        Description copied from class: LeafNode
        Subclasses must implement this, in compliance with the rules given in the return tag.
        Specified by:
        toString in class LeafNode<java.lang.String>
        Returns:
        the String representation of the node value, or the string "(null)" if the value is null.
      • unescapeQuotedString

        public static java.lang.String unescapeQuotedString​(java.lang.String string)
        Remove character escape codes.
        Parameters:
        string - escaped string
        Returns:
        unescaped string
      • doSetValue

        protected boolean doSetValue​(java.lang.String value)
        Sets the value of this string from a the string representation of this value in the (escaped) input configuration. The value supplied to this method needs un-escaping and will be un-escaped.
        Specified by:
        doSetValue in class LeafNode<java.lang.String>
        Parameters:
        value - the new value of this node.