Clover Coverage Report - Checkstyle
Coverage timestamp: Fri May 9 2008 10:48:13 EST
../../../../../../img/srcFileCovDistChart10.png 0% of files have more coverage
107   656   69   3.57
58   307   0.64   30
30     2.3  
1    
 
  ExpressionHandler       Line # 32 99% 0.9897436
69.01 107 69 69 0.64
 
  ( 10 of 31)
 
1    ////////////////////////////////////////////////////////////////////////////////
2    // checkstyle: Checks Java source code for adherence to a set of rules.
3    // Copyright (C) 2001-2005 Oliver Burn
4    //
5    // This library is free software; you can redistribute it and/or
6    // modify it under the terms of the GNU Lesser General Public
7    // License as published by the Free Software Foundation; either
8    // version 2.1 of the License, or (at your option) any later version.
9    //
10    // This library is distributed in the hope that it will be useful,
11    // but WITHOUT ANY WARRANTY; without even the implied warranty of
12    // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    // Lesser General Public License for more details.
14    //
15    // You should have received a copy of the GNU Lesser General Public
16    // License along with this library; if not, write to the Free Software
17    // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18    ////////////////////////////////////////////////////////////////////////////////
19    package com.puppycrawl.tools.checkstyle.checks.indentation;
20   
21    import java.util.Arrays;
22   
23    import com.puppycrawl.tools.checkstyle.api.DetailAST;
24    import com.puppycrawl.tools.checkstyle.api.TokenTypes;
25    import com.puppycrawl.tools.checkstyle.api.Utils;
26   
27    /**
28    * Abstract base class for all handlers.
29    *
30    * @author jrichard
31    */
 
32    public abstract class ExpressionHandler
33    {
34    /**
35    * The instance of <code>IndentationCheck</code> using this handler.
36    */
37    private IndentationCheck mIndentCheck;
38   
39    /** the AST which is handled by this handler */
40    private DetailAST mMainAst;
41   
42    /** name used during output to user */
43    private String mTypeName;
44   
45    /** containing AST handler */
46    private ExpressionHandler mParent;
47   
48    /** indentation amount for this handler */
49    private IndentLevel mLevel;
50   
51    /**
52    * Construct an instance of this handler with the given indentation check,
53    * name, abstract syntax tree, and parent handler.
54    *
55    * @param aIndentCheck the indentation check
56    * @param aTypeName the name of the handler
57    * @param aExpr the abstract syntax tree
58    * @param aParent the parent handler
59    */
 
60  1780 toggle public ExpressionHandler(IndentationCheck aIndentCheck,
61    String aTypeName, DetailAST aExpr, ExpressionHandler aParent)
62    {
63  1780 mIndentCheck = aIndentCheck;
64  1780 mTypeName = aTypeName;
65  1780 mMainAst = aExpr;
66  1780 mParent = aParent;
67    }
68   
69    /**
70    * Get the indentation amount for this handler. For performance reasons,
71    * this value is cached. The first time this method is called, the
72    * indentation amount is computed and stored. On further calls, the stored
73    * value is returned.
74    *
75    * @return the expected indentation amount
76