KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > innig > macker > structure > IncompleteClassInfo


1 /*______________________________________________________________________________
2  *
3  * Macker http://innig.net/macker/
4  *
5  * Copyright 2002-2003 Paul Cantrell
6  *
7  * This program is free software; you can redistribute it and/or modify it under
8  * the terms of the GNU General Public License version 2, as published by the
9  * Free Software Foundation. See the file LICENSE.html for more information.
10  *
11  * This program is distributed in the hope that it will be useful, but WITHOUT
12  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
13  * FOR A PARTICULAR PURPOSE. See the license for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with
16  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
17  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
18  *______________________________________________________________________________
19  */

20  
21 package net.innig.macker.structure;
22
23 import java.util.Set JavaDoc;
24 import net.innig.collect.MultiMap;
25
26 /**
27     Class info for a class which Macker couldn't load. Attempts to get attributes other than
28     the name throw {@link IncompleteClassInfoException}.
29 */

30 public class IncompleteClassInfo
31     extends AbstractClassInfo
32     {
33     IncompleteClassInfo(ClassManager classManager, String JavaDoc className)
34         {
35         super(classManager);
36         this.className = className;
37         }
38     
39     public String JavaDoc getFullName()
40         { return className; }
41
42     public boolean isComplete()
43         { return false; }
44     
45     public boolean isInterface() { throw newIncompleteException("get \"interface\" attribute of"); }
46     public boolean isAbstract() { throw newIncompleteException("get \"abstract\" attribute of"); }
47     public boolean isFinal() { throw newIncompleteException("get \"final\" attribute of"); }
48     public AccessModifier getAccessModifier() { throw newIncompleteException("determine accessibility of"); }
49     public ClassInfo getExtends() { throw newIncompleteException("determine superclass of"); }
50     public Set JavaDoc/*<String>*/ getImplements() { throw newIncompleteException("determine interfaces implemented by"); }
51     public MultiMap getReferences() { throw newIncompleteException("resolve references from"); }
52     
53     private IncompleteClassInfoException newIncompleteException(String JavaDoc action)
54         {
55         return new IncompleteClassInfoException(
56             "Unable to " + action + " class " + className
57             + ", because the class file could not be loaded."
58             + " Make sure it is in Macker's classpath.");
59         }
60     
61     private String JavaDoc className;
62     }
63
64
65
Popular Tags