Class 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
    • 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
    • Constructor Detail

      • CompilationUnit

        public CompilationUnit()
    • Method Detail

      • getFileType

        public java.lang.String getFileType()
        Specified by:
        getFileType in interface org.openrewrite.SourceFile
      • 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)
      • 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)