01: /* Copyright (C) 2004 - 2007 db4objects Inc. http://www.db4o.com
02:
03: This file is part of the db4o open source object database.
04:
05: db4o is free software; you can redistribute it and/or modify it under
06: the terms of version 2 of the GNU General Public License as published
07: by the Free Software Foundation and as clarified by db4objects' GPL
08: interpretation policy, available at
09: http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
10: Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
11: Suite 350, San Mateo, CA 94403, USA.
12:
13: db4o is distributed in the hope that it will be useful, but WITHOUT ANY
14: WARRANTY; without even the implied warranty of MERCHANTABILITY or
15: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16: for more details.
17:
18: You should have received a copy of the GNU General Public License along
19: with this program; if not, write to the Free Software Foundation, Inc.,
20: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21: package EDU.purdue.cs.bloat.reflect;
22:
23: import java.io.*;
24:
25: /**
26: * ClassInfoLoader provides an interface for loading classes. Implementing
27: * classes can load classes from a file, from the JVM, or elsewhere.
28: *
29: * @author Nate Nystrom (<a
30: * href="mailto:nystrom@cs.purdue.edu">nystrom@cs.purdue.edu</a>)
31: */
32: public interface ClassInfoLoader {
33: /**
34: * Load a class.
35: *
36: * @param name
37: * The name of the class to load, including the package name.
38: * @return A ClassInfo for the class.
39: * @exception ClassNotFoundException
40: * The class cannot be found in the class path.
41: * @see ClassInfo
42: */
43: public ClassInfo loadClass(String name)
44: throws ClassNotFoundException;
45:
46: /**
47: * Creates a new class or interface.
48: *
49: * @param modifiers
50: * The modifiers describing the newly-created class
51: * @param classIndex
52: * The index of the name of the newly-created class in its
53: * constant pool
54: * @param superClassIndex
55: * The index of the name of the newly-created class's superclass
56: * in its constant pool
57: * @param interfaceIndexes
58: * The indexes of the names of the interfaces that the
59: * newly-created class implements
60: * @param constants
61: * The constant pool for the newly created class (a list of
62: * {@link Constant}s).
63: */
64: public ClassInfo newClass(int modifiers, int classIndex,
65: int super ClassIndex, int[] interfaceIndexes,
66: java.util.List constants);
67:
68: /**
69: * Returns an <code>OutputStream</code> to which a class should be
70: * written.
71: */
72: OutputStream outputStreamFor(ClassInfo info) throws IOException;
73: }
|