java.lang.Object
com.fasterxml.jackson.dataformat.javaprop.util.JPropNode

public class JPropNode extends Object
Value in an ordered tree presentation built from an arbitrarily ordered set of flat input values. Since either index- OR name-based access is to be supported (similar to, say, Javascript objects) -- but only one, not both -- storage is bit of a hybrid. In addition, branches may also have values. So, code does bit coercion as necessary, trying to maintain something consistent and usable at all times, without failure.
  • Field Details

    • _value

      protected String _value
      Value for the path, for leaf nodes; usually null for branches. If both children and value exists, typically need to construct bogus value with empty String key.
    • _byIndex

      protected TreeMap<Integer,JPropNode> _byIndex
      Child entries with integral number index, if any.
    • _byName

      protected Map<String,JPropNode> _byName
      Child entries accessed with String property name, if any.
    • _hasContents

      protected boolean _hasContents
  • Constructor Details

    • JPropNode

      public JPropNode()
  • Method Details

    • setValue

      public JPropNode setValue(String v)
    • addByIndex

      public JPropNode addByIndex(int index)
    • addByName

      public JPropNode addByName(String name)
    • isLeaf

      public boolean isLeaf()
    • isArray

      public boolean isArray()
    • getValue

      public String getValue()
    • arrayContents

      public Iterator<JPropNode> arrayContents()
    • objectContents

      public Iterator<Map.Entry<String,JPropNode>> objectContents()
      Child entries accessed with String property name, if any.
    • asRaw

      public Object asRaw()
      Helper method, mostly for debugging/testing, to convert structure contained into simple List/Map/String equivalent.