Interface PrettyPrinter

    • Method Detail

      • printCompilationUnit

        java.lang.String printCompilationUnit​(CtCompilationUnit compilationUnit)
        Prints the compilation unit of module-info, package-info or types.
      • printPackageInfo

        java.lang.String printPackageInfo​(CtPackage pack)
        Prints the package info. It always resets the printing context at the beginning of this process.
      • printModuleInfo

        java.lang.String printModuleInfo​(CtModule module)
        Prints the module info. It always resets the printing context at the beginning of this process.
      • printTypes

        java.lang.String printTypes​(CtType<?>... type)
        Prints the types of one compilation unit It always resets the printing context at the beginning of this process.
      • printElement

        java.lang.String printElement​(CtElement element)
        Prints an element. This method shall be called by the toString() method of an element. It is responsible for any initialization required to print an arbitrary element.
        Parameters:
        element -
        Returns:
        A string containing the pretty printed element (and descendants).
      • getResult

        java.lang.String getResult()
        Gets the contents of the compilation unit.
      • calculate

        void calculate​(CtCompilationUnit sourceCompilationUnit,
                       java.util.List<CtType<?>> types)
        Calculates the resulting source file for a list of types. The source compilation unit is required for calculating the line numbers mapping. It always resets the printing context at the beginning of this process.
      • getLineNumberMapping

        java.util.Map<java.lang.Integer,​java.lang.Integer> getLineNumberMapping()
        Gets the line number mapping between the generated code and the original code.
      • prettyprint

        java.lang.String prettyprint​(CtElement ctElement)
        pretty-prints the element, call #toString() to get the result