KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > puppycrawl > tools > checkstyle > checks > whitespace > OperatorWrapOption


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.whitespace;
20
21 import com.puppycrawl.tools.checkstyle.checks.AbstractOption;
22 import java.util.HashMap JavaDoc;
23 import java.util.Map JavaDoc;
24
25 /**
26  * Represents the options for wrapping on an operator.
27  *
28  * @author Rick Giles
29  * @version 1.0
30  */

31 public final class OperatorWrapOption
32     extends AbstractOption
33 {
34     /** maps from a string representation to an option */
35     private static final Map JavaDoc STR_TO_OPT = new HashMap JavaDoc();
36
37     /** Require that the operator is on a new line. */
38     public static final OperatorWrapOption NL = new OperatorWrapOption("nl");
39     /** Require that the operator is at the end of the line. */
40     public static final OperatorWrapOption EOL = new OperatorWrapOption("eol");
41
42     /**
43      * Creates a new <code>OperatorWrapOption</code> instance.
44      *
45      * @param aStrRep the string representation
46      */

47     private OperatorWrapOption(String JavaDoc aStrRep)
48     {
49         super(aStrRep);
50     }
51
52     /** {@inheritDoc} */
53     protected Map JavaDoc getStrToOpt()
54     {
55         return STR_TO_OPT;
56     }
57 }
58
Popular Tags