1 ///////////////////////////////////////////////////////////////////////////////////////////////
2 // checkstyle: Checks Java source code and other text files for adherence to a set of rules.
3 // Copyright (C) 2001-2025 the original author or authors.
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
20 package com.puppycrawl.tools.checkstyle.checks.imports;
21
22 /**
23 * Represents the policy for checking import order statements.
24 *
25 * @see ImportOrderCheck
26 */
27 public enum ImportOrderOption {
28
29 /**
30 * Represents the policy that static imports are all at the top.
31 * For example:
32 *
33 * <pre>
34 * import static java.awt.Button.ABORT;
35 * import static java.io.File.createTempFile;
36 * import static javax.swing.WindowConstants.*;
37 *
38 * import java.awt.Button;
39 * import java.awt.event.ActionEvent;
40 * </pre>
41 */
42 TOP,
43
44 /**
45 * Represents the policy that static imports are above the local group.
46 * For example:
47 *
48 * <pre>
49 * import static java.awt.Button.A;
50 * import static javax.swing.WindowConstants.*;
51 * import java.awt.Dialog;
52 * import javax.swing.JComponent;
53 *
54 * import static java.io.File.createTempFile;
55 * import java.io.File;
56 * import java.io.IOException;
57 * </pre>
58 */
59 ABOVE,
60
61 /**
62 * Represents the policy that static imports are processed like non static
63 * imports. For example:
64 *
65 * <pre>
66 * import java.awt.Button;
67 * import static java.awt.Button.ABORT;
68 * import java.awt.Dialog;
69 *
70 * import static javax.swing.WindowConstants.HIDE_ON_CLOSE;
71 * import javax.swing.JComponent;
72 * </pre>
73 */
74 INFLOW,
75
76 /**
77 * Represents the policy that static imports are under the local group.
78 * For example:
79 *
80 * <pre>
81 * import java.awt.Dialog;
82 * import javax.swing.JComponent;
83 * import static java.awt.Button.A;
84 * import static javax.swing.WindowConstants.*;
85 *
86 * import java.io.File;
87 * import java.io.IOException;
88 * import static java.io.File.createTempFile;
89 * </pre>
90 */
91 UNDER,
92
93 /**
94 * Represents the policy that static imports are all at the bottom.
95 * For example:
96 *
97 * <pre>
98 * import java.awt.Button;
99 * import java.awt.event.ActionEvent;
100 *
101 * import static java.awt.Button.ABORT;
102 * import static java.io.File.createTempFile;
103 * import static javax.swing.WindowConstants.*;
104 * </pre>
105 */
106 BOTTOM,
107
108 }