01: /* Options Copyright (C) 1998-2002 Jochen Hoenicke.
02: *
03: * This program is free software; you can redistribute it and/or modify
04: * it under the terms of the GNU Lesser General Public License as published by
05: * the Free Software Foundation; either version 2, or (at your option)
06: * any later version.
07: *
08: * This program is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11: * GNU General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public License
14: * along with this program; see the file COPYING.LESSER. If not, write to
15: * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
16: *
17: * $Id: Options.java,v 4.2.2.2 2002/05/28 17:34:03 hoenicke Exp $
18: */
19:
20: package jode.decompiler;
21:
22: import jode.bytecode.ClassInfo;
23: import jode.bytecode.InnerClassInfo;
24:
25: public class Options {
26: public static final int TAB_SIZE_MASK = 0x0f;
27: public static final int BRACE_AT_EOL = 0x10;
28: public static final int BRACE_FLUSH_LEFT = 0x20;
29: public static final int GNU_SPACING = 0x40;
30: public static final int SUN_STYLE = 0x14;
31: public static final int GNU_STYLE = 0x42;
32: public static final int PASCAL_STYLE = 0x24;
33:
34: public static final int OPTION_LVT = 0x0001;
35: public static final int OPTION_INNER = 0x0002;
36: public static final int OPTION_ANON = 0x0004;
37: public static final int OPTION_PUSH = 0x0008;
38: public static final int OPTION_PRETTY = 0x0010;
39: public static final int OPTION_DECRYPT = 0x0020;
40: public static final int OPTION_ONETIME = 0x0040;
41: public static final int OPTION_IMMEDIATE = 0x0080;
42: public static final int OPTION_VERIFY = 0x0100;
43: public static final int OPTION_CONTRAFO = 0x0200;
44:
45: public static int options = OPTION_LVT | OPTION_INNER | OPTION_ANON
46: | OPTION_PRETTY | OPTION_DECRYPT | OPTION_VERIFY
47: | OPTION_CONTRAFO;
48:
49: public static int outputStyle = SUN_STYLE;
50:
51: public final static boolean doAnonymous() {
52: return (options & OPTION_ANON) != 0;
53: }
54:
55: public final static boolean doInner() {
56: return (options & OPTION_INNER) != 0;
57: }
58:
59: public static boolean skipClass(ClassInfo clazz) {
60: InnerClassInfo[] outers = clazz.getOuterClasses();
61: if (outers != null) {
62: if (outers[0].outer == null) {
63: return doAnonymous();
64: } else {
65: return doInner();
66: }
67: }
68: return false;
69: }
70: }
|