Class SpelNodeInclusionPolicy
- java.lang.Object
-
- com.graphaware.common.policy.inclusion.spel.SpelInclusionPolicy
-
- com.graphaware.common.policy.inclusion.spel.SpelNodeInclusionPolicy
-
- All Implemented Interfaces:
EntityInclusionPolicy<Node>
,InclusionPolicy
,NodeInclusionPolicy
,ObjectInclusionPolicy<Node>
public class SpelNodeInclusionPolicy extends SpelInclusionPolicy implements NodeInclusionPolicy
NodeInclusionPolicy
based on a SPEL expression. The expression can use methods defined inAttachedNodeExpressions
.
-
-
Field Summary
-
Fields inherited from class com.graphaware.common.policy.inclusion.spel.SpelInclusionPolicy
exp, expressionNode
-
-
Constructor Summary
Constructors Constructor Description SpelNodeInclusionPolicy(String expression)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable<Node>
getAll(Transaction tx)
Get allEntity
s matching the policy from the database.boolean
include(Node node)
Include the given object?-
Methods inherited from class com.graphaware.common.policy.inclusion.spel.SpelInclusionPolicy
equals, hashCode, toString
-
-
-
-
Constructor Detail
-
SpelNodeInclusionPolicy
public SpelNodeInclusionPolicy(String expression)
-
-
Method Detail
-
include
public boolean include(Node node)
Description copied from interface:ObjectInclusionPolicy
Include the given object?- Specified by:
include
in interfaceObjectInclusionPolicy<Node>
- Parameters:
node
- to check.- Returns:
- true iff the given object should be included.
-
getAll
public Iterable<Node> getAll(Transaction tx)
Description copied from interface:EntityInclusionPolicy
Get allEntity
s matching the policy from the database. This can be a naive implementation retrieving allEntity
s and calling theObjectInclusionPolicy.include(Object)
method for each one of them, but it could also be more clever than that and directly retrieve the includedEntity
s from an index, by label, etc.- Specified by:
getAll
in interfaceEntityInclusionPolicy<Node>
- Parameters:
tx
- to retrieve theEntity
s from.- Returns:
- all
Entity
s matching the policy.
-
-