001/////////////////////////////////////////////////////////////////////////////////////////////// 002// checkstyle: Checks Java source code and other text files for adherence to a set of rules. 003// Copyright (C) 2001-2026 the original author or authors. 004// 005// This library is free software; you can redistribute it and/or 006// modify it under the terms of the GNU Lesser General Public 007// License as published by the Free Software Foundation; either 008// version 2.1 of the License, or (at your option) any later version. 009// 010// This library is distributed in the hope that it will be useful, 011// but WITHOUT ANY WARRANTY; without even the implied warranty of 012// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013// Lesser General Public License for more details. 014// 015// You should have received a copy of the GNU Lesser General Public 016// License along with this library; if not, write to the Free Software 017// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 018/////////////////////////////////////////////////////////////////////////////////////////////// 019 020package com.puppycrawl.tools.checkstyle.checks.imports; 021 022/** 023 * Represents the policy for checking import order statements. 024 * 025 * @see ImportOrderCheck 026 */ 027public enum ImportOrderOption { 028 029 /** 030 * Represents the policy that static imports are all at the top. 031 * For example: 032 * 033 * {@snippet lang="text" : 034 * import static java.awt.Button.ABORT; 035 * import static java.io.File.createTempFile; 036 * import static javax.swing.WindowConstants.*; 037 * 038 * import java.awt.Button; 039 * import java.awt.event.ActionEvent; 040 * } 041 */ 042 TOP, 043 044 /** 045 * Represents the policy that static imports are above the local group. 046 * For example: 047 * 048 * {@snippet lang="text" : 049 * import static java.awt.Button.A; 050 * import static javax.swing.WindowConstants.*; 051 * import java.awt.Dialog; 052 * import javax.swing.JComponent; 053 * 054 * import static java.io.File.createTempFile; 055 * import java.io.File; 056 * import java.io.IOException; 057 * } 058 */ 059 ABOVE, 060 061 /** 062 * Represents the policy that static imports are processed like non static imports. For example: 063 * 064 * {@snippet lang="text" : 065 * import java.awt.Button; 066 * import static java.awt.Button.ABORT; 067 * import java.awt.Dialog; 068 * 069 * import static javax.swing.WindowConstants.HIDE_ON_CLOSE; 070 * import javax.swing.JComponent; 071 * } 072 */ 073 INFLOW, 074 075 /** 076 * Represents the policy that static imports are under the local group. 077 * For example: 078 * 079 * {@snippet lang="text" : 080 * import java.awt.Dialog; 081 * import javax.swing.JComponent; 082 * import static java.awt.Button.A; 083 * import static javax.swing.WindowConstants.*; 084 * 085 * import java.io.File; 086 * import java.io.IOException; 087 * import static java.io.File.createTempFile; 088 * } 089 */ 090 UNDER, 091 092 /** 093 * Represents the policy that static imports are all at the bottom. 094 * For example: 095 * 096 * {@snippet lang="text" : 097 * import java.awt.Button; 098 * import java.awt.event.ActionEvent; 099 * 100 * import static java.awt.Button.ABORT; 101 * import static java.io.File.createTempFile; 102 * import static javax.swing.WindowConstants.*; 103 * } 104 */ 105 BOTTOM, 106 107}