Package org.mule.runtime.ast.api.util
Enum Class AstTraversalDirection
- All Implemented Interfaces:
Serializable,Comparable<AstTraversalDirection>,Constable
Strategy use to navigates the whole AST
- Since:
- 1.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionabstract Spliterator<ComponentAst>recursiveSpliterator(ComponentAst component) Creates aSpliteratorfor aComponentAstthat travers through thisComponentAstand its children recursively by currentAstTraversalDirection.Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components) Enhances theStreamby adding hierarchy context to eachComponentAst.Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, boolean ignoreParameterComplexValues) Enhances theStreamby adding hierarchy context to eachComponentAst.Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, List<ComponentAst> commonAncestors) Enhances theStreamby adding hierarchy context to eachComponentAst.Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, List<ComponentAst> commonAncestors, boolean ignoreParameterComplexValues) Enhances theStreamby adding hierarchy context to eachComponentAst.static AstTraversalDirectionReturns the enum constant of this class with the specified name.static AstTraversalDirection[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOP_DOWN
Navigate the whole AST from top down.e.g Given following
ComponentAst:- root
- component-1
- component-1.1
- component-2
- component-2.1
- component-2.1.1
- component-2.2
Will navigate
ComponentAstthrough:- root
- component-1
- component-1.1
- component-2
- component-2.1
- component-2.1.1
- component-2
-
BOTTOM_UP
Navigate the whole AST from top down.e.g Given following
ComponentAst:- root
- component-1
- component-1.1
- component-2
- component-2.1
- component-2.1.1
- component-2.2
Will navigate
ComponentAstthrough:- component-1.1
- component-1
- component-2.1.1
- component-2.1
- component-2.2
- component-2
- root
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
recursiveSpliterator
Creates aSpliteratorfor aComponentAstthat travers through thisComponentAstand its children recursively by currentAstTraversalDirection.- Parameters:
component- theComponentAstto navigate.- Returns:
- a
Spliteratorfor thiscomponentand its children recursively that navigates the whole AST by currentAstTraversalDirection.
-
recursiveStreamWithHierarchy
public Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components) Enhances theStreamby adding hierarchy context to eachComponentAst.The
Streamis traversed inAstTraversalDirectiondirectionThe elements of the
StreamarePairs:- the first element is the same component that would be obtained by calling
ArtifactAst.recursiveStream(). - the second element is the hierarchy that was traversed to get to the first element, the first element being a root and the last being the direct parent of the first element of the pair.
- the first element is the same component that would be obtained by calling
-
recursiveStreamWithHierarchy
public Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, boolean ignoreParameterComplexValues) Enhances theStreamby adding hierarchy context to eachComponentAst.The
Streamis traversed inAstTraversalDirectiondirectionThe elements of the
StreamarePairs:- the first element is the same component that would be obtained by calling
ArtifactAst.recursiveStream(). - the second element is the hierarchy that was traversed to get to the first element, the first element being a root and the last being the direct parent of the first element of the pair.
- the first element is the same component that would be obtained by calling
-
recursiveStreamWithHierarchy
public Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, List<ComponentAst> commonAncestors) Enhances theStreamby adding hierarchy context to eachComponentAst.The
Streamis traversed inAstTraversalDirectiondirectionThe elements of the
StreamarePairs:- the first element is the same component that would be obtained by calling
ArtifactAst.recursiveStream(). - the second element is the hierarchy that was traversed to get to the first element, the first element being a root and the last being the direct parent of the first element of the pair.
- Parameters:
components- theStreamto enrich.commonAncestors- anyComponentAsthierarchy that is common for all the components in the providedcomponents.- Returns:
- an enhanced
Streamwith hierarchy context.
- the first element is the same component that would be obtained by calling
-
recursiveStreamWithHierarchy
public Stream<org.mule.runtime.api.util.Pair<ComponentAst,List<ComponentAst>>> recursiveStreamWithHierarchy(Stream<ComponentAst> components, List<ComponentAst> commonAncestors, boolean ignoreParameterComplexValues) Enhances theStreamby adding hierarchy context to eachComponentAst.The
Streamis traversed inAstTraversalDirectiondirectionThe elements of the
StreamarePairs:- the first element is the same component that would be obtained by calling
ArtifactAst.recursiveStream(). - the second element is the hierarchy that was traversed to get to the first element, the first element being a root and the last being the direct parent of the first element of the pair.
- Parameters:
components- theStreamto enrich.commonAncestors- anyComponentAsthierarchy that is common for all the components in the providedcomponents.ignoreParameterComplexValues- whether the returnedStreamwill contain any complex values in component parameters.- Returns:
- an enhanced
Streamwith hierarchy context.
- the first element is the same component that would be obtained by calling
-