com.fasterxml.jackson.dataformat.javaprop.util

## Class JPropNode

- 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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected TreeMap<Integer,JPropNode>` | `_byIndex` Child entries with integral number index, if any.
    `protected Map<String,JPropNode>` | `_byName` Child entries accessed with String property name, if any.
    `protected boolean` | `_hasContents`
    `protected String` | `_value` Value for the path, for leaf nodes; usually null for branches.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JPropNode()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `JPropNode` | `addByIndex(int index)`
    `JPropNode` | `addByName(String name)`
    `Iterator<JPropNode>` | `arrayContents()`
    `Object` | `asRaw()` Helper method, mostly for debugging/testing, to convert structure contained into simple List/Map/String equivalent.
    `String` | `getValue()`
    `boolean` | `isArray()`
    `boolean` | `isLeaf()`
    `Iterator<Map.Entry<String,JPropNode>>` | `objectContents()` Child entries accessed with String property name, if any.
    `JPropNode` | `setValue(String v)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _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 Detail

    - #### JPropNode

          public JPropNode()

  - ### Method Detail

    - #### 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.

Copyright © 2017 FasterXML. All rights reserved.