Package org.springframework.data.spel
Class ExpressionDependencies
java.lang.Object
org.springframework.data.spel.ExpressionDependencies
- All Implemented Interfaces:
Iterable<ExpressionDependencies.ExpressionDependency>
,Supplier<Stream<ExpressionDependencies.ExpressionDependency>>
,Streamable<ExpressionDependencies.ExpressionDependency>
public class ExpressionDependencies
extends Object
implements Streamable<ExpressionDependencies.ExpressionDependency>
Value object capturing dependencies to a method or property/field that is referenced from a SpEL expression.
- Since:
- 2.4
- Author:
- Mark Paluch, Christoph Strobl
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Value object to describe a dependency to a method or property/field that is referenced from a SpEL expression. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionDependencies
discover
(org.springframework.expression.Expression expression) Discover all expression dependencies that are referenced in theexpression root
.static ExpressionDependencies
discover
(org.springframework.expression.spel.SpelNode root, boolean topLevelOnly) Discover all expression dependencies that are referenced in theexpression root
.boolean
int
hashCode()
iterator()
static ExpressionDependencies
merged
(Iterable<ExpressionDependencies> dependencies) Return anExpressionDependencies
object representing the merged collection ofdependencies
withing the givenExpressionDependencies
collection.mergeWith
(ExpressionDependencies other) Create newExpressionDependencies
that contains all dependencies from this object andother
.static ExpressionDependencies
none()
Return an emptyExpressionDependencies
object.static ExpressionDependencies
of
(Collection<ExpressionDependencies.ExpressionDependency> dependencies) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
none
Return an emptyExpressionDependencies
object.- Returns:
- empty dependencies.
-
of
public static ExpressionDependencies of(Collection<ExpressionDependencies.ExpressionDependency> dependencies) - Returns:
ExpressionDependencies
holding the givendependencies
ornone
if the collection isempty
.
-
merged
Return anExpressionDependencies
object representing the merged collection ofdependencies
withing the givenExpressionDependencies
collection.- Returns:
ExpressionDependencies
holding a set of mergeddependencies
ornone
if the givenIterable
isempty
.
-
discover
Discover all expression dependencies that are referenced in theexpression root
.- Parameters:
expression
- the SpEL expression to inspect.- Returns:
- a set of
ExpressionDependencies
.
-
discover
public static ExpressionDependencies discover(org.springframework.expression.spel.SpelNode root, boolean topLevelOnly) Discover all expression dependencies that are referenced in theexpression root
.- Parameters:
root
- the SpEL expression to inspect.topLevelOnly
- whether to include top-level dependencies only. Top-level dependencies are dependencies that indicate the start of a compound expression and required to resolve the next expression item.- Returns:
- a set of
ExpressionDependencies
.
-
mergeWith
Create newExpressionDependencies
that contains all dependencies from this object andother
. The merged dependencies are guaranteed to not contain duplicates.- Parameters:
other
- the otherExpressionDependencies
object.- Returns:
- new merged
ExpressionDependencies
object.
-
iterator
- Specified by:
iterator
in interfaceIterable<ExpressionDependencies.ExpressionDependency>
-
equals
-
hashCode
public int hashCode()
-