KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jode > decompiler > Options


1 /* Options Copyright (C) 1998-2002 Jochen Hoenicke.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU Lesser General Public License as published by
5  * the Free Software Foundation; either version 2, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * 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 import jode.bytecode.ClassInfo;
22 import jode.bytecode.InnerClassInfo;
23
24 public class Options {
25     public static final int TAB_SIZE_MASK = 0x0f;
26     public static final int BRACE_AT_EOL = 0x10;
27     public static final int BRACE_FLUSH_LEFT = 0x20;
28     public static final int GNU_SPACING = 0x40;
29     public static final int SUN_STYLE = 0x14;
30     public static final int GNU_STYLE = 0x42;
31     public static final int PASCAL_STYLE = 0x24;
32
33     public static final int OPTION_LVT = 0x0001;
34     public static final int OPTION_INNER = 0x0002;
35     public static final int OPTION_ANON = 0x0004;
36     public static final int OPTION_PUSH = 0x0008;
37     public static final int OPTION_PRETTY = 0x0010;
38     public static final int OPTION_DECRYPT = 0x0020;
39     public static final int OPTION_ONETIME = 0x0040;
40     public static final int OPTION_IMMEDIATE = 0x0080;
41     public static final int OPTION_VERIFY = 0x0100;
42     public static final int OPTION_CONTRAFO = 0x0200;
43
44     public static int options =
45     OPTION_LVT | OPTION_INNER | OPTION_ANON | OPTION_PRETTY |
46     OPTION_DECRYPT | OPTION_VERIFY | OPTION_CONTRAFO;
47
48     public static int outputStyle = SUN_STYLE;
49
50     public final static boolean doAnonymous() {
51     return (options & OPTION_ANON) != 0;
52     }
53
54     public final static boolean doInner() {
55     return (options & OPTION_INNER) != 0;
56     }
57
58     public static boolean skipClass(ClassInfo clazz) {
59     InnerClassInfo[] outers = clazz.getOuterClasses();
60     if (outers != null) {
61         if (outers[0].outer == null) {
62         return doAnonymous();
63         } else {
64         return doInner();
65         }
66     }
67     return false;
68     }
69 }
70
Popular Tags