Package org.openrewrite.java.tree
Class JContainer<T>
java.lang.Object
org.openrewrite.java.tree.JContainer<T>
- Type Parameters:
T
- The type of the inner list of elements.
AST elements that contain lists of trees with some delimiter like parentheses, e.g. method arguments,
annotation arguments, catch variable declarations.
Sometimes the delimiter surrounds the list. Parentheses surround method arguments. Sometimes the delimiter only precedes the list. Throws statements on method declarations are preceded by the "throws" keyword.
Sometimes containers are optional in the grammar, as in the case of annotation arguments. Sometimes they are required, as in the case of method invocation arguments.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
static class
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> JContainer<T>
build
(List<JRightPadded<T>> elements) static <T> JContainer<T>
build
(Space before, List<JRightPadded<T>> elements, org.openrewrite.marker.Markers markers) static <T> JContainer<T>
empty()
org.openrewrite.marker.Markers
map
(UnaryOperator<T> map) toString()
withBefore
(Space before) static <J2 extends J>
JContainer<J2>withElements
(JContainer<J2> before, @Nullable List<J2> elements) static <J2 extends J>
@Nullable JContainer<J2>withElementsNullable
(@Nullable JContainer<J2> before, @Nullable List<J2> elements) withMarkers
(org.openrewrite.marker.Markers markers)
-
Method Details
-
build
-
build
public static <T> JContainer<T> build(Space before, List<JRightPadded<T>> elements, org.openrewrite.marker.Markers markers) -
empty
-
withBefore
-
withMarkers
-
getMarkers
public org.openrewrite.marker.Markers getMarkers() -
getElements
-
getBefore
-
map
-
getLastSpace
-
getPadding
-
withElementsNullable
@Nullable public static <J2 extends J> @Nullable JContainer<J2> withElementsNullable(@Nullable @Nullable JContainer<J2> before, @Nullable @Nullable List<J2> elements) -
withElements
public static <J2 extends J> JContainer<J2> withElements(JContainer<J2> before, @Nullable @Nullable List<J2> elements) -
toString
-