Package org.openrewrite.java.dataflow
Class LocalFlowSpec<Source extends Expression,Sink extends J>
java.lang.Object
org.openrewrite.java.dataflow.LocalFlowSpec<Source,Sink>
- Direct Known Subclasses:
LocalTaintFlowSpec
@Incubating(since="7.24.0")
public abstract class LocalFlowSpec<Source extends Expression,Sink extends J>
extends Object
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionClass<?>Class<?>booleanisAdditionalFlowStep(Expression srcExpression, org.openrewrite.Cursor srcCursor, Expression sinkExpression, org.openrewrite.Cursor sinkCursor) takes an existing flow-step in the graph and offers a potential next flow step.booleanisBarrier(Expression expression, org.openrewrite.Cursor cursor) Holds if flow through `expression` is prohibited.booleanisBarrierGuard(Guard guard, boolean branch) final booleanisFlowStep(Expression srcExpression, org.openrewrite.Cursor srcCursor, Expression sinkExpression, org.openrewrite.Cursor sinkCursor) abstract booleanThe following is always true:sink == cursor.getValue().abstract booleanThe following is always true:source == cursor.getValue().
-
Field Details
-
sourceType
-
sinkType
-
-
Constructor Details
-
LocalFlowSpec
protected LocalFlowSpec()
-
-
Method Details
-
getSourceType
-
getSinkType
-
isSource
The following is always true:source == cursor.getValue().- Parameters:
source- TheExpressionto check to determine if it should be considered flow-graph source.cursor- The current cursor position of thesource.- Returns:
trueifsourceandcursorshould be considered the source or root of a flow graph.
-
isSink
The following is always true:sink == cursor.getValue().- Parameters:
sink- TheExpressionto check to determine if it should be considered a flow-graph sink.cursor- The current cursor position of thesink.- Returns:
trueifsinkandcursorshould be considered the sink or leaf of a flow graph.
-
isFlowStep
public final boolean isFlowStep(Expression srcExpression, org.openrewrite.Cursor srcCursor, Expression sinkExpression, org.openrewrite.Cursor sinkCursor) -
isAdditionalFlowStep
public boolean isAdditionalFlowStep(Expression srcExpression, org.openrewrite.Cursor srcCursor, Expression sinkExpression, org.openrewrite.Cursor sinkCursor) takes an existing flow-step in the graph and offers a potential next flow step. The method can then decide if the offered potential next flow step should be considered a valid next flow step in the graph. Allows for ad-hoc taint tracking by allowing for additional, non-default flow steps to be added to the flow graph. The following is always true:srcExpression == srcCursor.getValue() && sinkExpression == sinkCursor.getValue(). -
isBarrierGuard
-
isBarrier
Holds if flow through `expression` is prohibited.
-