com.github.fge.jackson.jsonpointer
Class TokenResolver<T extends com.fasterxml.jackson.core.TreeNode>

java.lang.Object
  extended by com.github.fge.jackson.jsonpointer.TokenResolver<T>
Type Parameters:
T - the type of tree to traverse
Direct Known Subclasses:
JsonNodeResolver

@ThreadSafe
public abstract class TokenResolver<T extends com.fasterxml.jackson.core.TreeNode>
extends Object

Reference token traversal class

This class is meant to be extended and implemented for all types of trees inheriting TreeNode.

This package contains one implementation of this class for JsonNode.

Note that its equals(Object), hashCode() and toString() are final.

See Also:
JsonNodeResolver

Field Summary
protected  ReferenceToken token
          The associated reference token
 
Constructor Summary
protected TokenResolver(ReferenceToken token)
          The only constructor
 
Method Summary
 boolean equals(Object obj)
           
abstract  T get(T node)
          Advance one level into the tree
 ReferenceToken getToken()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

token

protected final ReferenceToken token
The associated reference token

Constructor Detail

TokenResolver

protected TokenResolver(ReferenceToken token)
The only constructor

Parameters:
token - the reference token
Method Detail

get

public abstract T get(T node)
Advance one level into the tree

Note: it is required that this method return null on traversal failure.

Note 2: handling null itself is up to implementations.

Parameters:
node - the node to traverse
Returns:
the other node, or null if no such node exists for that token

getToken

public final ReferenceToken getToken()

hashCode

public final int hashCode()
Overrides:
hashCode in class Object

equals

public final boolean equals(Object obj)
Overrides:
equals in class Object

toString

public final String toString()
Overrides:
toString in class Object