Class PredicateContextImpl
- java.lang.Object
-
- com.jayway.jsonpath.internal.path.PredicateContextImpl
-
- All Implemented Interfaces:
Predicate.PredicateContext
public class PredicateContextImpl extends java.lang.Object implements Predicate.PredicateContext
-
-
Field Summary
Fields Modifier and Type Field Description private Configuration
configuration
private java.lang.Object
contextDocument
private java.util.HashMap<Path,java.lang.Object>
documentPathCache
private static org.slf4j.Logger
logger
private java.lang.Object
rootDocument
-
Constructor Summary
Constructors Constructor Description PredicateContextImpl(java.lang.Object contextDocument, java.lang.Object rootDocument, Configuration configuration, java.util.HashMap<Path,java.lang.Object> documentPathCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Configuration
configuration()
Configuration to use when evaluatingjava.util.HashMap<Path,java.lang.Object>
documentPathCache()
java.lang.Object
evaluate(Path path)
java.lang.Object
item()
Returns the current item being evaluated by this predicate<T> T
item(java.lang.Class<T> clazz)
Returns the current item being evaluated by this predicate.java.lang.Object
root()
Returns the root document (the complete JSON)
-
-
-
Field Detail
-
logger
private static final org.slf4j.Logger logger
-
contextDocument
private final java.lang.Object contextDocument
-
rootDocument
private final java.lang.Object rootDocument
-
configuration
private final Configuration configuration
-
documentPathCache
private final java.util.HashMap<Path,java.lang.Object> documentPathCache
-
-
Constructor Detail
-
PredicateContextImpl
public PredicateContextImpl(java.lang.Object contextDocument, java.lang.Object rootDocument, Configuration configuration, java.util.HashMap<Path,java.lang.Object> documentPathCache)
-
-
Method Detail
-
evaluate
public java.lang.Object evaluate(Path path)
-
documentPathCache
public java.util.HashMap<Path,java.lang.Object> documentPathCache()
-
item
public java.lang.Object item()
Description copied from interface:Predicate.PredicateContext
Returns the current item being evaluated by this predicate- Specified by:
item
in interfacePredicate.PredicateContext
- Returns:
- current document
-
item
public <T> T item(java.lang.Class<T> clazz) throws MappingException
Description copied from interface:Predicate.PredicateContext
Returns the current item being evaluated by this predicate. It will be mapped to the provided class- Specified by:
item
in interfacePredicate.PredicateContext
- Returns:
- current document
- Throws:
MappingException
-
root
public java.lang.Object root()
Description copied from interface:Predicate.PredicateContext
Returns the root document (the complete JSON)- Specified by:
root
in interfacePredicate.PredicateContext
- Returns:
- root document
-
configuration
public Configuration configuration()
Description copied from interface:Predicate.PredicateContext
Configuration to use when evaluating- Specified by:
configuration
in interfacePredicate.PredicateContext
- Returns:
- configuration
-
-