Class ClassPrinter


  • public abstract class ClassPrinter
    extends java.lang.Object
    Class file printing code responsible for presenting all kind decoded class information.
    • Constructor Detail

      • ClassPrinter

        protected ClassPrinter​(de.carne.mcd.io.MCDOutputBuffer out,
                               ClassInfo classInfo)
    • Method Detail

      • getInstance

        public static ClassPrinter getInstance​(de.carne.mcd.io.MCDOutputBuffer out,
                                               ClassInfo classInfo)
        Gets a ClassPrinter instance suitable for printing the submitted class information.
        Parameters:
        out - the MCDOutputBuffer to print to.
        classInfo - the ClassInfo to print.
        Returns:
        a ClassPrinter instance suitable for the submitted class information.
      • output

        public de.carne.mcd.io.MCDOutputBuffer output()
        Gets the underlying MCDOutputBuffer instance.
        Returns:
        the underlying MCDOutputBuffer instance.
      • print

        public abstract void print()
                            throws java.io.IOException
        Prints the class information.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • println

        public ClassPrinter println()
                             throws java.io.IOException
        Prints a line break.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • print

        public ClassPrinter print​(java.lang.String text)
                           throws java.io.IOException
        Prints a standard text.
        Parameters:
        text - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • println

        public ClassPrinter println​(java.lang.String text)
                             throws java.io.IOException
        Prints a standard text and a line break.
        Parameters:
        text - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printValue

        public ClassPrinter printValue​(java.lang.String value)
                                throws java.io.IOException
        Prints a value text.
        Parameters:
        value - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnValue

        public ClassPrinter printlnValue​(java.lang.String value)
                                  throws java.io.IOException
        Prints a value text and a line break.
        Parameters:
        value - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printComment

        public ClassPrinter printComment​(java.lang.String comment)
                                  throws java.io.IOException
        Prints a comment text.
        Parameters:
        comment - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnComment

        public ClassPrinter printlnComment​(java.lang.String comment)
                                    throws java.io.IOException
        Prints a comment text and a line break.
        Parameters:
        comment - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printKeyword

        public ClassPrinter printKeyword​(java.lang.String keyword)
                                  throws java.io.IOException
        Prints a keyword text.
        Parameters:
        keyword - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnKeyword

        public ClassPrinter printlnKeyword​(java.lang.String keyword)
                                    throws java.io.IOException
        Prints a keyword text and a line break.
        Parameters:
        keyword - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printOperator

        public ClassPrinter printOperator​(java.lang.String operator)
                                   throws java.io.IOException
        Prints an operator text.
        Parameters:
        operator - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnOperator

        public ClassPrinter printlnOperator​(java.lang.String operator)
                                     throws java.io.IOException
        Prints an operator text and a line break.
        Parameters:
        operator - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printLabel

        public ClassPrinter printLabel​(java.lang.String label)
                                throws java.io.IOException
        Prints a label text.
        Parameters:
        label - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printlnLabel

        public ClassPrinter printlnLabel​(java.lang.String label)
                                  throws java.io.IOException
        Prints a label text and a line break.
        Parameters:
        label - the text to print.
        Returns:
        this instance for chaining.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printFlagsComment

        public void printFlagsComment​(java.util.Map<java.lang.Integer,​java.lang.String> flagSymbols,
                                      int flags)
                               throws java.io.IOException
        Prints flag symbols as comment.
        Parameters:
        flagSymbols - the flag symbols to use.
        flags - the flags to print.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printFlagsKeyword

        public void printFlagsKeyword​(java.util.Map<java.lang.Integer,​java.lang.String> flagSymbols,
                                      int flags)
                               throws java.io.IOException
        Prints flag symbols as keywords.
        Parameters:
        flagSymbols - the flag symbols to use.
        flags - the flags to print.
        Throws:
        java.io.IOException - if an I/O error occurs.
      • printClassComment

        protected void printClassComment()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • printClassPackage

        protected void printClassPackage()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • printClassAnnotation

        protected void printClassAnnotation()
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • printAnnotations

        protected void printAnnotations​(java.util.List<Attribute> attributes,
                                        ClassContext context)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • printModuleInfo

        protected void printModuleInfo()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • printClassSignature

        protected void printClassSignature​(java.lang.String classKeyword)
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • printFields

        protected void printFields()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • printMethods

        protected void printMethods()
                             throws java.io.IOException
        Throws:
        java.io.IOException