Brooklyn

brooklyn.util.collections
[Java] Class Jsonya.Navigator

java.lang.Object
  brooklyn.util.collections.Jsonya.Navigator

@SuppressWarnings({"rawtypes","unchecked"})
public static class Jsonya.Navigator

Field Summary
protected Function creationInPreviousFocus

protected java.lang.Object focus

protected java.lang.Class mapType

protected java.lang.Object root

 
Constructor Summary
Jsonya.Navigator(java.lang.Object backingStore, java.lang.Class mapType)

 
Method Summary
Navigator add(java.lang.Object o1, java.lang.Object... others)

adds the given arguments to a list at this point (will not descend into maps, and will not flatten lists)

protected static void addFlattened(java.util.Collection target, java.lang.Object item)

protected static void addInternal(java.lang.Object initialFocus, java.lang.Object currentFocus, java.lang.Object o1, java.lang.Object... others)

Navigator addUnflattened(java.lang.Object o1, java.lang.Object... others)

Navigator at(java.lang.Object pathSegment, java.lang.Object... furtherPathSegments)

returns the navigator focussed at the indicated key sequence in the given map

Navigator atArray(java.lang.Object[] furtherPathSegments)

protected Navigator down(java.lang.Object pathSegment)

utility for at(Object, Object...), taking one argument at a time

protected Navigator downList(java.lang.Object pathSegment)

protected Navigator downMap(java.lang.Object pathSegment)

java.lang.Object get()

returns the object at the focus, or null if none

java.lang.Object get(java.lang.Class type)

returns the object at the focus, casted to the given type, null if none

java.lang.Object get(java.lang.Object pathSegment, java.lang.Object... furtherPathSegments)

java.lang.Object getFocusMap()

returns a java.util.Map at the given focus, creating if needed (so never null), throwing if it exists already and is not a map

java.lang.Object getRoot()

returns the object at the root

java.lang.Object getRootMap()

returns the java.util.Map at the root, throwing if root is not a map

Navigator list()

ensures the given focus is a list

Navigator map()

ensures the given focus is a map, creating if needed (and creating inside the list if it is in a list)

protected java.util.List newList()

protected java.util.Map newMap()

Navigator put(java.lang.Object k1, java.lang.Object v1, java.lang.Object... kvOthers)

puts the given key-value pair at the current focus (or multiple such), creating a map if needed, replacing any values stored against keys supplied here; if you wish to merge deep maps, see add(Object, Object...)

Navigator put(java.util.Map map)

as put(Object, Object, Object...) for the kv-pairs in the given map

protected static void putInternal(java.util.Map target, java.lang.Object k1, java.lang.Object v1, java.lang.Object... kvOthers)

Navigator root()

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Field Detail

creationInPreviousFocus

protected Function creationInPreviousFocus


focus

protected java.lang.Object focus


mapType

protected final java.lang.Class mapType


root

protected final java.lang.Object root


 
Constructor Detail

Jsonya.Navigator

public Jsonya.Navigator(java.lang.Object backingStore, java.lang.Class mapType)


 
Method Detail

add

public Navigator add(java.lang.Object o1, java.lang.Object... others)
adds the given arguments to a list at this point (will not descend into maps, and will not flatten lists)


addFlattened

protected static void addFlattened(java.util.Collection target, java.lang.Object item)


addInternal

protected static void addInternal(java.lang.Object initialFocus, java.lang.Object currentFocus, java.lang.Object o1, java.lang.Object... others)


addUnflattened

public Navigator addUnflattened(java.lang.Object o1, java.lang.Object... others)


at

public Navigator at(java.lang.Object pathSegment, java.lang.Object... furtherPathSegments)
returns the navigator focussed at the indicated key sequence in the given map


atArray

public Navigator atArray(java.lang.Object[] furtherPathSegments)


down

protected Navigator down(java.lang.Object pathSegment)
utility for at(Object, Object...), taking one argument at a time


downList

protected Navigator downList(java.lang.Object pathSegment)


downMap

protected Navigator downMap(java.lang.Object pathSegment)


get

public java.lang.Object get()
returns the object at the focus, or null if none


get

public java.lang.Object get(java.lang.Class type)
returns the object at the focus, casted to the given type, null if none


get

public java.lang.Object get(java.lang.Object pathSegment, java.lang.Object... furtherPathSegments)


getFocusMap

public java.lang.Object getFocusMap()
returns a java.util.Map at the given focus, creating if needed (so never null), throwing if it exists already and is not a map


getRoot

public java.lang.Object getRoot()
returns the object at the root


getRootMap

public java.lang.Object getRootMap()
returns the java.util.Map at the root, throwing if root is not a map


list

public Navigator list()
ensures the given focus is a list


map

public Navigator map()
ensures the given focus is a map, creating if needed (and creating inside the list if it is in a list)


newList

protected java.util.List newList()


newMap

protected java.util.Map newMap()


put

public Navigator put(java.lang.Object k1, java.lang.Object v1, java.lang.Object... kvOthers)
puts the given key-value pair at the current focus (or multiple such), creating a map if needed, replacing any values stored against keys supplied here; if you wish to merge deep maps, see add(Object, Object...)


put

public Navigator put(java.util.Map map)
as put(Object, Object, Object...) for the kv-pairs in the given map


putInternal

protected static void putInternal(java.util.Map target, java.lang.Object k1, java.lang.Object v1, java.lang.Object... kvOthers)


root

public Navigator root()


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.