001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: *
023: * Free Software Foundation, Inc.
024: * 59 Temple Place, Suite 330
025: * Boston, MA 02111-1307 USA
026: *
027: * @author Scott Ferguson
028: */
029:
030: package com.caucho.bytecode;
031:
032: /**
033: * Represents an introspected java class.
034: */
035: public interface JType {
036: /**
037: * Returns the type name.
038: */
039: public String getName();
040:
041: /**
042: * Returns the print name, i.e. Java source name.
043: */
044: public String getPrintName();
045:
046: /**
047: * Returns the parameter types.
048: */
049: public JType[] getActualTypeArguments();
050:
051: /**
052: * Returns the raw type.
053: */
054: public JClass getRawType();
055:
056: // class methods
057:
058: /**
059: * Returns true for a primitive class.
060: */
061: public boolean isPrimitive();
062:
063: /**
064: * Returns true for a public class.
065: */
066: public boolean isPublic();
067:
068: /**
069: * Returns true for an class
070: */
071: public boolean isAbstract();
072:
073: /**
074: * Returns true for a final class
075: */
076: public boolean isFinal();
077:
078: /**
079: * Returns true for an interface
080: */
081: public boolean isInterface();
082:
083: /**
084: * Returns the superclass.
085: */
086: public JClass getSuperClass();
087:
088: /**
089: * Returns the interfaces.
090: */
091: public JClass[] getInterfaces();
092:
093: /**
094: * Returns true for an array class.
095: */
096: public boolean isArray();
097:
098: /**
099: * 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 cl);
107:
108: /**
109: * Returns true if the jClass is assignable to the class.
110: */
111: public boolean isAssignableFrom(Class 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 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: }
|