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
Nested ClassesModifier and TypeClassDescriptionstatic classValue object to describe a dependency to a method or property/field that is referenced from a SpEL expression. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExpressionDependenciesdiscover(Expression expression) Discover all expression dependencies that are referenced in theexpression root.static ExpressionDependenciesDiscover all expression dependencies that are referenced in theexpression root.booleaninthashCode()iterator()static ExpressionDependenciesmerged(Iterable<ExpressionDependencies> dependencies) Return anExpressionDependenciesobject representing the merged collection ofdependencieswithing the givenExpressionDependenciescollection.mergeWith(ExpressionDependencies other) Create newExpressionDependenciesthat contains all dependencies from this object andother.static ExpressionDependenciesnone()Return an emptyExpressionDependenciesobject.static ExpressionDependenciesof(Collection<ExpressionDependencies.ExpressionDependency> dependencies) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
none
Return an emptyExpressionDependenciesobject.- Returns:
- empty dependencies.
-
of
public static ExpressionDependencies of(Collection<ExpressionDependencies.ExpressionDependency> dependencies) - Returns:
ExpressionDependenciesholding the givendependenciesornoneif the collection isempty.
-
merged
Return anExpressionDependenciesobject representing the merged collection ofdependencieswithing the givenExpressionDependenciescollection.- Returns:
ExpressionDependenciesholding a set of mergeddependenciesornoneif the givenIterableisempty.
-
discover
Discover all expression dependencies that are referenced in theexpression root.- Parameters:
expression- the SpEL expression to inspect.- Returns:
- a set of
ExpressionDependencies.
-
discover
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 newExpressionDependenciesthat contains all dependencies from this object andother. The merged dependencies are guaranteed to not contain duplicates.- Parameters:
other- the otherExpressionDependenciesobject.- Returns:
- new merged
ExpressionDependenciesobject.
-
iterator
- Specified by:
iteratorin interfaceIterable<ExpressionDependencies.ExpressionDependency>
-
equals
-
hashCode
public int hashCode()
-