Class ArrayInitHandler


public class ArrayInitHandler extends BlockParentHandler
Handler for array initialization blocks.
  • Field Details

    • NOT_EXIST

      private static final int NOT_EXIST
      Constant to define that the required character does not exist at any position.
      See Also:
  • Constructor Details

    • ArrayInitHandler

      public ArrayInitHandler(IndentationCheck indentCheck, DetailAST ast, AbstractExpressionHandler parent)
      Construct an instance of this handler with the given indentation check, abstract syntax tree, and parent handler.
      Parameters:
      indentCheck - the indentation check
      ast - the abstract syntax tree
      parent - the parent handler
  • Method Details

    • getIndentImpl

      protected IndentLevel getIndentImpl()
      Description copied from class: AbstractExpressionHandler
      Compute the indentation amount for this handler.
      Overrides:
      getIndentImpl in class AbstractExpressionHandler
      Returns:
      the expected indentation amount
    • getTopLevelAst

      protected DetailAST getTopLevelAst()
      Description copied from class: BlockParentHandler
      Get the top level expression being managed by this handler.
      Overrides:
      getTopLevelAst in class BlockParentHandler
      Returns:
      the top level expression
    • getLeftCurly

      protected DetailAST getLeftCurly()
      Description copied from class: BlockParentHandler
      Get the left curly brace portion of the expression we are handling.
      Overrides:
      getLeftCurly in class BlockParentHandler
      Returns:
      the left curly brace expression
    • curlyIndent

      protected IndentLevel curlyIndent()
      Description copied from class: BlockParentHandler
      Get the expected indentation level for the curly braces.
      Overrides:
      curlyIndent in class BlockParentHandler
      Returns:
      the curly brace indentation level
    • getRightCurly

      protected DetailAST getRightCurly()
      Description copied from class: BlockParentHandler
      Get the right curly brace portion of the expression we are handling.
      Overrides:
      getRightCurly in class BlockParentHandler
      Returns:
      the right curly brace expression
    • canChildrenBeNested

      protected boolean canChildrenBeNested()
      Description copied from class: BlockParentHandler
      Determines if child elements within the expression may be nested.
      Overrides:
      canChildrenBeNested in class BlockParentHandler
      Returns:
      false
    • getListChild

      protected DetailAST getListChild()
      Description copied from class: BlockParentHandler
      Get the child element representing the list of statements.
      Overrides:
      getListChild in class BlockParentHandler
      Returns:
      the statement list child
    • getChildrenExpectedIndent

      protected IndentLevel getChildrenExpectedIndent()
      Description copied from class: BlockParentHandler
      Gets indentation level expected for children.
      Overrides:
      getChildrenExpectedIndent in class BlockParentHandler
      Returns:
      indentation level expected for children
    • getNextFirstNonBlankOnLineAfter

      private int getNextFirstNonBlankOnLineAfter(int lineNo, int columnNo)
      Returns column number of first non-blank char after specified column on specified line or NOT_EXIST if such char doesn't exist.
      Parameters:
      lineNo - number of line on which we search
      columnNo - number of column after which we search
      Returns:
      column number of first non-blank char after specified column on specified line or NOT_EXIST if such char doesn't exist.
    • getLineWrappingIndentation

      private int getLineWrappingIndentation()
      A shortcut for IndentationCheck property.
      Returns:
      value of lineWrappingIndentation property of IndentationCheck