KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > bytecode > JType


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  *
23  * Free Software Foundation, Inc.
24  * 59 Temple Place, Suite 330
25  * Boston, MA 02111-1307 USA
26  *
27  * @author Scott Ferguson
28  */

29
30 package com.caucho.bytecode;
31
32 /**
33  * Represents an introspected java class.
34  */

35 public interface JType {
36   /**
37    * Returns the type name.
38    */

39   public String JavaDoc getName();
40
41   /**
42    * Returns the print name, i.e. Java source name.
43    */

44   public String JavaDoc getPrintName();
45
46   /**
47    * Returns the parameter types.
48    */

49   public JType []getActualTypeArguments();
50
51   /**
52    * Returns the raw type.
53    */

54   public JClass getRawType();
55
56   // class methods
57

58   /**
59    * Returns true for a primitive class.
60    */

61   public boolean isPrimitive();
62   
63   /**
64    * Returns true for a public class.
65    */

66   public boolean isPublic();
67   
68   /**
69    * Returns true for an class
70    */

71   public boolean isAbstract();
72   
73   /**
74    * Returns true for a final class
75    */

76   public boolean isFinal();
77   
78   /**
79    * Returns true for an interface
80    */

81   public boolean isInterface();
82
83   /**
84    * Returns the superclass.
85    */

86   public JClass getSuperClass();
87
88   /**
89    * Returns the interfaces.
90    */

91   public JClass []getInterfaces();
92
93   /**
94    * Returns true for an array class.
95    */

96   public boolean isArray();
97
98   /**
99    * Returns the component for a class.
100    */

101   public JClass getComponentType();
102
103   /**
104    * Returns true if the jClass is assignable to the class.
105    */

106   public boolean isAssignableTo(Class JavaDoc cl);
107
108   /**
109    * Returns true if the jClass is assignable to the class.
110    */

111   public boolean isAssignableFrom(Class JavaDoc cl);
112
113   /**
114    * Returns true if the jClass is assignable to the class.
115    */

116   public boolean isAssignableFrom(JClass cl);
117
118   /**
119    * Returns the declared methods
120    */

121   public JMethod []getDeclaredMethods();
122
123   /**
124    * Returns the public methods
125    */

126   public JMethod []getMethods();
127
128   /**
129    * Returns the matching method.
130    */

131   public JMethod getMethod(String JavaDoc name, JClass []param);
132
133   /**
134    * Returns the declared fields
135    */

136   public JField []getDeclaredFields();
137
138   /**
139    * Returns the fields
140    */

141   public JField []getFields();
142 }
143
Popular Tags