Class MutableTokenWriter

    • Constructor Detail

      • MutableTokenWriter

        public MutableTokenWriter​(Environment env)
    • Method Detail

      • isMuted

        public boolean isMuted()
        Returns:
        true if tokens are ignored. false if they are forwarded to `delegate`
      • setMuted

        public void setMuted​(boolean muted)
        Parameters:
        muted - true if tokens are ignored. false if they are forwarded to `delegate`
      • setOriginSourceUsesTabulations

        public void setOriginSourceUsesTabulations​(boolean originSourceUsesTabulations)
        Parameters:
        originSourceUsesTabulations - whether or not the origin source uses tabs for indentation.
      • setOriginSourceTabulationSize

        public void setOriginSourceTabulationSize​(int originSourceTabulationSize)
        Parameters:
        originSourceTabulationSize - the amount of indentation used in the origin source.
      • writeOperator

        public TokenWriter writeOperator​(String token)
        Description copied from interface: TokenWriter
        Writes one operator. = > < ! ~ ? : == <= >= != && || ++ -- + - * / & | ^ % << >> >>> += -= *= /= &= |= ^= %= <<= >>= >>>= instanceof
        Specified by:
        writeOperator in interface TokenWriter
      • writeKeyword

        public TokenWriter writeKeyword​(String token)
        Description copied from interface: TokenWriter
        writes a keyword abstract continue for new switch assert default goto package synchronized boolean do if private this break double implements protected throw byte else import public throws case enum instanceof return transient catch extends int short try char final interface static void class finally long strictfp volatile const float native super while
        Specified by:
        writeKeyword in interface TokenWriter
      • reset

        public void reset()
        Description copied from interface: TokenWriter
        resets to the initial state
        Specified by:
        reset in interface TokenWriter
      • directPrint

        public void directPrint​(String text)
        Prints a piece of text regardless of mute status Don't call this, this is dangerous and irregular design.
      • write

        public TokenWriter write​(String text)
        writes the piece of text if not muted