Class AbstractParenPadCheck

All Implemented Interfaces:
Configurable, Contextualizable
Direct Known Subclasses:
ParenPadCheck, TypecastParenPadCheck

public abstract class AbstractParenPadCheck extends AbstractCheck
Abstract class for checking the padding of parentheses. That is whether a space is required after a left parenthesis and before a right parenthesis, or such spaces are forbidden.
  • Field Details

  • Constructor Details

    • AbstractParenPadCheck

      protected AbstractParenPadCheck(String msgWsFollowed, String msgWsNotFollowed, String msgWsPreceded, String msgWsNotPreceded)
      Creates a new AbstractParenPadCheck instance.
      Parameters:
      msgWsFollowed - message key for followed whitespace
      msgWsNotFollowed - message key for not followed whitespace
      msgWsPreceded - message key for preceded whitespace
      msgWsNotPreceded - message key for not preceded whitespace
  • Method Details

    • setOption

      public void setOption(String optionStr)
      Specify policy on how to pad parentheses.
      Parameters:
      optionStr - string to decode option from
      Throws:
      IllegalArgumentException - if unable to decode
    • processLeft

      protected void processLeft(DetailAST ast)
      Process a token representing a left parentheses.
      Parameters:
      ast - the token representing a left parentheses
    • processRight

      protected void processRight(DetailAST ast)
      Process a token representing a right parentheses.
      Parameters:
      ast - the token representing a right parentheses