Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
LeftCurlyOption |
|
| 0.0;0 |
1 | //////////////////////////////////////////////////////////////////////////////// | |
2 | // checkstyle: Checks Java source code for adherence to a set of rules. | |
3 | // Copyright (C) 2001-2014 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.blocks; | |
20 | ||
21 | /** | |
22 | * Represents the options for placing the left curly brace <code>'{'</code>. | |
23 | * | |
24 | * @author Oliver Burn | |
25 | * @version 1 | |
26 | */ | |
27 | 5 | public enum LeftCurlyOption |
28 | { | |
29 | /** | |
30 | * Represents the policy for placing the brace at the end of line. For | |
31 | * example: | |
32 | * <pre> | |
33 | * if (condition) { | |
34 | * ... | |
35 | * </pre> | |
36 | **/ | |
37 | 1 | EOL, |
38 | ||
39 | /** | |
40 | * Represents the policy that if the brace will fit on the first line of | |
41 | * the statement, taking into account maximum line length, then apply | |
42 | * <code>EOL</code> rule. Otherwise apply the <code>NL</code> | |
43 | * rule. <code>NLOW</code> is a mnemonic for "new line on wrap". | |
44 | * | |
45 | * <p> For the example above Checkstyle will enforce: | |
46 | * | |
47 | * <pre> | |
48 | * if (condition) { | |
49 | * ... | |
50 | * </pre> | |
51 | * | |
52 | * But for a statement spanning multiple lines, Checkstyle will enforce: | |
53 | * | |
54 | * <pre> | |
55 | * if (condition1 && condition2 && | |
56 | * condition3 && condition4) | |
57 | * { | |
58 | * ... | |
59 | * </pre> | |
60 | **/ | |
61 | 1 | NLOW, |
62 | ||
63 | /** | |
64 | * Represents the policy that the brace must always be on a new line. For | |
65 | * example: | |
66 | * <pre> | |
67 | * if (condition) | |
68 | * { | |
69 | * ... | |
70 | * </pre> | |
71 | */ | |
72 | 1 | NL; |
73 | } |