KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > proguard > classfile > constant > Constant


1 /*
2  * ProGuard -- shrinking, optimization, obfuscation, and preverification
3  * of Java bytecode.
4  *
5  * Copyright (c) 2002-2007 Eric Lafortune (eric@graphics.cornell.edu)
6  *
7  * This library is free software; you can redistribute it and/or modify it
8  * under the terms of the GNU General Public License as published by the Free
9  * Software Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
15  * for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library; if not, write to the Free Software Foundation,
19  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20  */

21 package proguard.classfile.constant;
22
23 import proguard.classfile.*;
24 import proguard.classfile.constant.visitor.ConstantVisitor;
25
26 import java.io.*;
27
28 /**
29  * This abstract class represents an entry in the ConstantPool. Specific types
30  * of entries are subclassed from it.
31  *
32  * @author Eric Lafortune
33  */

34 public abstract class Constant implements VisitorAccepter
35 {
36     //public int u1tag;
37
//public byte info[];
38

39     /**
40      * An extra field in which visitors can store information.
41      */

42     public Object JavaDoc visitorInfo;
43
44
45     // Abstract methods to be implemented by extensions.
46

47     /**
48      * Returns the constant pool info tag that specifies the entry type.
49      */

50     public abstract int getTag();
51
52
53     /**
54      * Accepts the given visitor.
55      */

56     public abstract void accept(Clazz clazz, ConstantVisitor constantVisitor);
57
58
59     // Implementations for VisitorAccepter.
60

61     public Object JavaDoc getVisitorInfo()
62     {
63         return visitorInfo;
64     }
65
66     public void setVisitorInfo(Object JavaDoc visitorInfo)
67     {
68         this.visitorInfo = visitorInfo;
69     }
70 }
71
Popular Tags