KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > edu > umd > cs > findbugs > classfile > IClassPath


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

19
20 package edu.umd.cs.findbugs.classfile;
21
22 import java.io.FileNotFoundException JavaDoc;
23 import java.io.IOException JavaDoc;
24 import java.io.InputStream JavaDoc;
25 import java.util.Iterator JavaDoc;
26
27 /**
28  * A classpath from which resources (classes and other files)
29  * may be loaded. Essentially, this is just a list of codebases.
30  *
31  * @author David Hovemeyer
32  */

33 public interface IClassPath {
34     /**
35      * Add a codebase.
36      * The object will be interrogated to determine whether it is an
37      * application codebase or an auxiliary codebase.
38      * Application codebases must be scannable.
39      *
40      * @param codeBase the codebase to add
41      */

42     public void addCodeBase(ICodeBase codeBase);
43
44     /**
45      * Return an iterator over the application codebases.
46      *
47      * @return iterator over the application codebases
48      */

49     public Iterator JavaDoc<? extends ICodeBase> appCodeBaseIterator();
50     
51     /**
52      * Return an iterator over the auxiliary codebases.
53      *
54      * @return iterator over the auxiliary codebases
55      */

56     public Iterator JavaDoc<? extends ICodeBase> auxCodeBaseIterator();
57     
58     /**
59      * Lookup a resource by name.
60      *
61      * @param resourceName name of the resource to look up
62      * @return ICodeBaseEntry representing the resource
63      * @throws ResourceNotFoundException if the resource is not found
64      */

65     public ICodeBaseEntry lookupResource(String JavaDoc resourceName) throws ResourceNotFoundException;
66     
67     /**
68      * Add a resource name to codebase entry mapping.
69      * Once this is done, future lookups of this resource will
70      * automatically resolve to the given codebase entry.
71      *
72      * @param resourceName the resource name to map
73      * @param codeBaseEntry the codebase entry to use for this resource
74      */

75     public void mapResourceNameToCodeBaseEntry(String JavaDoc resourceName, ICodeBaseEntry codeBaseEntry);
76     
77     /**
78      * Close all of the code bases that are part of this class path.
79      * This should be done once the client is finished with the classpath.
80      */

81     public void close();
82
83 }
84
Popular Tags