Package org.openrewrite.java.tree
Class J.CompilationUnit
- java.lang.Object
-
- org.openrewrite.java.tree.J.CompilationUnit
-
- All Implemented Interfaces:
java.io.Serializable
,J
,org.openrewrite.SourceFile
,org.openrewrite.Tree
- Enclosing interface:
- J
public static class J.CompilationUnit extends java.lang.Object implements J, org.openrewrite.SourceFile
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openrewrite.java.tree.J
J.AnnotatedType, J.Annotation, J.ArrayAccess, J.ArrayType, J.Assert, J.Assign, J.AssignOp, J.Binary, J.Block<T extends J>, J.Break, J.Case, J.ClassDecl, J.CompilationUnit, J.Continue, J.DoWhileLoop, J.Empty, J.EnumValue, J.EnumValueSet, J.FieldAccess, J.ForEachLoop, J.ForLoop, J.Ident, J.If, J.Import, J.InstanceOf, J.Label, J.Lambda, J.Literal, J.MemberReference, J.MethodDecl, J.MethodInvocation, J.Modifier, J.MultiCatch, J.NewArray, J.NewClass, J.Package, J.ParameterizedType, J.Parentheses<T extends J>, J.Primitive, J.Return, J.Switch, J.Synchronized, J.Ternary, J.Throw, J.Try, J.TypeCast, J.TypeParameter, J.TypeParameters, J.Unary, J.UnparsedSource, J.VariableDecls, J.WhileLoop, J.Wildcard
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
jacksonPolymorphicTypeTag
Because Jackson will not place a polymorphic type tag on the root of the AST when we are serializing a list of ASTs together
-
Constructor Summary
Constructors Constructor Description CompilationUnit()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> R
acceptJava(JavaSourceVisitor<R> v)
static J.CompilationUnit
buildEmptyClass(java.nio.file.Path sourceSet, java.lang.String packageName, java.lang.String className)
java.util.List<J.MethodInvocation>
findMethodCalls(java.lang.String signature)
java.util.Set<NameTree>
findType(java.lang.String clazz)
java.lang.String
getFileType()
java.lang.String
getJacksonPolymorphicTypeTag()
boolean
hasImport(java.lang.String clazz)
boolean
hasType(java.lang.String clazz)
org.openrewrite.Refactor<J.CompilationUnit,J>
refactor()
-
-
-
Field Detail
-
jacksonPolymorphicTypeTag
protected final java.lang.String jacksonPolymorphicTypeTag
Because Jackson will not place a polymorphic type tag on the root of the AST when we are serializing a list of ASTs together- See Also:
- Constant Field Values
-
-
Method Detail
-
getFileType
public java.lang.String getFileType()
- Specified by:
getFileType
in interfaceorg.openrewrite.SourceFile
-
acceptJava
public <R> R acceptJava(JavaSourceVisitor<R> v)
- Specified by:
acceptJava
in interfaceJ
-
hasImport
public boolean hasImport(java.lang.String clazz)
-
hasType
public boolean hasType(java.lang.String clazz)
-
findMethodCalls
public java.util.List<J.MethodInvocation> findMethodCalls(java.lang.String signature)
-
findType
public java.util.Set<NameTree> findType(java.lang.String clazz)
-
refactor
public org.openrewrite.Refactor<J.CompilationUnit,J> refactor()
-
getJacksonPolymorphicTypeTag
public java.lang.String getJacksonPolymorphicTypeTag()
-
buildEmptyClass
public static J.CompilationUnit buildEmptyClass(java.nio.file.Path sourceSet, java.lang.String packageName, java.lang.String className)
-
-