Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.mule.module.json
Class JsonData

    java.lang.Object
      org.mule.module.json.JsonData

All Implemented Interfaces:
  Serializable

    public class JsonData

extends Object
implements Serializable

A wrapper for the `JsonNode` object that allows for nested object keys i.e. user/name will return the name property on the user object.

There is no 'xpath' for JSON yet (though I expect Jackson to do implement this at some point). This class provides a simple way to navigate a Json data structure. To select a child entry use - `person/name`

to access array data, use square braces with an index value i.e. `person/addresses[0]/postcode

or

[0]/arrayElement`

Also, multi-dimensional arrays can be accessed using: `filters[1]/init[1][0]`

if a Json property name contains a '/' the name needs to be quoted with single quotes i.e.

`results/'http://foo.com'/value`

See Also:
  Serialized Form

Constructor Summary
`JsonData(InputStream node)`
`JsonData(org.codehaus.jackson.JsonNode node)`
`JsonData(Reader node)`
`JsonData(String node)`
`JsonData(URL node)`

Method Summary
`boolean` | `equals(Object obj)`
`org.codehaus.jackson.JsonNode` | `get(int index)`
`Object` | `get(String expression)`
`int` | `hashCode()`
`boolean` | `hasNode(String key)`
`boolean` | `isArray()`
`protected List<String>` | `parseTokens(String expresion)`
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### JsonData

    public JsonData(org.codehaus.jackson.JsonNode node)

### JsonData

    public JsonData(URL node)
             throws IOException

Throws:
  `IOException`

### JsonData

    public JsonData(InputStream node)
             throws IOException

Throws:
  `IOException`

### JsonData

    public JsonData(Reader node)
             throws IOException

Throws:
  `IOException`

### JsonData

    public JsonData(String node)
             throws IOException

Throws:
  `IOException`

Method Detail

### get

    public org.codehaus.jackson.JsonNode get(int index)

### isArray

    public boolean isArray()

### get

    public Object get(String expression)

### hasNode

    public boolean hasNode(String key)

### parseTokens

    protected List<String> parseTokens(String expresion)

### equals

    public boolean equals(Object obj)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.