Class TokenPrinterEvent

java.lang.Object
spoon.support.sniper.internal.TokenPrinterEvent
All Implemented Interfaces:
PrinterEvent

public abstract class TokenPrinterEvent extends Object implements PrinterEvent
Represents an action of Printer, which prints a token
  • Constructor Details

  • Method Details

    • getRole

      public CtRole getRole()
      Specified by:
      getRole in interface PrinterEvent
      Returns:
      role of printed source code of element in scope of its parent
    • getElement

      public @Nullable SourcePositionHolder getElement()
      Specified by:
      getElement in interface PrinterEvent
      Returns:
      printed element or null if printing a primitive token
    • getToken

      public @Nullable String getToken()
      Returns:
      printed token or null if printing complex element or comment
    • isWhitespace

      public boolean isWhitespace()
      Returns:
      true if printing white space token. It means New line, space or TAB.
    • getType

      public TokenType getType()
      Returns the token type
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getTokenType

      public TokenType getTokenType()