Package com.ibm.fhir.path.evaluator
Class FHIRPathEvaluator
- java.lang.Object
 - 
- com.ibm.fhir.path.evaluator.FHIRPathEvaluator
 
 
- 
public class FHIRPathEvaluator extends Object
A FHIRPath evaluation engine that implements the FHIRPath 2.0.0 specification 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFHIRPathEvaluator.EvaluatingVisitorstatic classFHIRPathEvaluator.EvaluationContextA context object used to pass information to/from the FHIRPath evaluation engine 
- 
Field Summary
Fields Modifier and Type Field Description static Collection<FHIRPathNode>SINGLETON_FALSEstatic Collection<FHIRPathNode>SINGLETON_TRUE 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<FHIRPathNode>evaluate(Resource resource, String expr)Evaluate a FHIRPath expression against aResourceCollection<FHIRPathNode>evaluate(Element element, String expr)Evaluate a FHIRPath expression against anElementCollection<FHIRPathNode>evaluate(Visitable resourceOrElement, String expr)Collection<FHIRPathNode>evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr)Evaluate a FHIRPath expression using an existing evaluation contextCollection<FHIRPathNode>evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr, FHIRPathNode node)Evaluate a FHIRPath expression using an existing evaluation context against a FHIRPath nodeCollection<FHIRPathNode>evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr, Collection<FHIRPathNode> initialContext)Evaluate a FHIRPathExpression using an existing EvaluationContext against a collection of FHIRPath nodesCollection<FHIRPathNode>evaluate(String expr)Evaluate a FHIRPath expressionstatic FHIRPathEvaluatorevaluator()Static factory method for creating FHIRPathEvaluator instancesFHIRPathEvaluator.EvaluationContextgetEvaluationContext()Get the EvaluationContext associated with this FHIRPathEvaluator 
 - 
 
- 
- 
Field Detail
- 
SINGLETON_TRUE
public static final Collection<FHIRPathNode> SINGLETON_TRUE
 
- 
SINGLETON_FALSE
public static final Collection<FHIRPathNode> SINGLETON_FALSE
 
 - 
 
- 
Method Detail
- 
getEvaluationContext
public FHIRPathEvaluator.EvaluationContext getEvaluationContext()
Get the EvaluationContext associated with this FHIRPathEvaluator- Returns:
 - get the EvaluationContext associated with this FHIRPathEvaluator
 
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(String expr) throws FHIRPathException
Evaluate a FHIRPath expression- Parameters:
 expr- the FHIRPath expression to evaluate- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(Visitable resourceOrElement, String expr) throws FHIRPathException
- Parameters:
 resourceOrElement- theResourceorElementexpr- the FHIRPath expression to evaluate- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(Resource resource, String expr) throws FHIRPathException
Evaluate a FHIRPath expression against aResource- Parameters:
 resource- the resourceexpr- the FHIRPath expression to evaluate- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(Element element, String expr) throws FHIRPathException
Evaluate a FHIRPath expression against anElement- Parameters:
 element- the elementexpr- the FHIRPath expression to evaluate- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr) throws FHIRPathException
Evaluate a FHIRPath expression using an existing evaluation context- Parameters:
 evaluationContext- the evaluation contextexpr- the FHIRPath expression to evaluate- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr, FHIRPathNode node) throws FHIRPathException
Evaluate a FHIRPath expression using an existing evaluation context against a FHIRPath node- Parameters:
 evaluationContext- the evaluation contextexpr- the FHIRPath expression to evaluatenode- the FHIRPath node- Returns:
 - the result of evaluation as a non-null, potentially empty collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluate
public Collection<FHIRPathNode> evaluate(FHIRPathEvaluator.EvaluationContext evaluationContext, String expr, Collection<FHIRPathNode> initialContext) throws FHIRPathException
Evaluate a FHIRPathExpression using an existing EvaluationContext against a collection of FHIRPath nodes- Parameters:
 evaluationContext- the evaluation contextexpr- the FHIRPath expression to evaluateinitialContext- the initial context as a non-null, potentially empty collection of FHIRPath nodes- Returns:
 - the result of evaluation as a collection of FHIRPath nodes
 - Throws:
 NullPointerException- if any of the parameters are nullFHIRPathException- if an exception occurs during evaluation
 
- 
evaluator
public static FHIRPathEvaluator evaluator()
Static factory method for creating FHIRPathEvaluator instances- Returns:
 - a new FHIRPathEvaluator instance
 
 
 - 
 
 -