|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.dynamicjava.symbol.SymbolUtil
public class SymbolUtil
| Constructor Summary | |
|---|---|
SymbolUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.Iterable<VariableType> |
allTypeParameters(DJClass c)
Determine all the in-scope type parameters of c, ordered outermost to innermost. |
static Thunk<java.lang.Class<?>> |
arrayClassThunk(Thunk<java.lang.Class<?>> element)
|
static Library |
classLibrary(java.lang.ClassLoader loader)
Create an appropriate Library for the given ClassLoader, based on the available reflection APIs. |
static boolean |
dynamicallyEncloses(DJClass outer,
DJClass inner)
Determine whether inner is non-statically nested within outer. |
static DJClass |
dynamicOuterClass(DJClass c)
Determine the most deeply-nested dynamically-enclosing class of c. |
static ClassType |
dynamicOuterClassType(ClassType t)
Determine the type of an enclosing object of a value of the given type. |
static java.lang.Object |
initialValue(java.lang.Class<?> c)
Get the initial (zero) value of a field with the given class. |
static boolean |
isVararg(Function f)
Test whether the function's last parameter has a VarargArrayType type. |
static java.lang.Iterable<DJClass> |
outerClassChain(DJClass c)
Produces a list of classes enclosing the given class, from the most outer to the most inner. |
static DJClass |
outermostClass(DJClass c)
Produce the first element of the class's outerClassChain(). |
static java.lang.Iterable<Type> |
parameterTypes(Function f)
|
static java.lang.String |
shortName(DJClass c)
Produce a short name for the given class -- including all outer class names, but excluding the package name. |
static ClassType |
thisType(DJClass c)
Create the type corresponding to this within the body of c |
static Type |
typeOfGeneralClass(java.lang.Class<?> c,
TypeSystem ts)
Create a type corresponding to an arbitrary reflection class, which may represent a primitive, an array, or a class/interface. |
static Type |
typeOfPrimitiveClass(java.lang.Class<?> c)
Convert a Class object representing a primitive type to the corresponding
Type. |
static DJClass |
wrapClass(java.lang.Class<?> c)
Create an appropriate DJClass for the given Class, based on the available reflection APIs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SymbolUtil()
| Method Detail |
|---|
public static java.lang.Iterable<DJClass> outerClassChain(DJClass c)
c).
Note that classes that indirectly enclose this class, such as a class containing
a method that declares this class, are not included in the result.
public static DJClass outermostClass(DJClass c)
outerClassChain().
public static boolean dynamicallyEncloses(DJClass outer,
DJClass inner)
inner is non-statically nested within outer. This is the
case iff outer appears in inner's outer class chain, and the next class
in the chain is not declared static, or outer equals inner.
public static DJClass dynamicOuterClass(DJClass c)
c.
The result is null if {code c} is a top-level class or is declared in a strictly
static context. On the other hand, for generality, if class A has non-static inner class B, which
in turn declares static class C, the result for C is A, not null or B
(such declarations are not allowed in Java, and have limited syntactic support).
public static ClassType dynamicOuterClassType(ClassType t)
dynamicOuterClass(t.ofClass()), where the parameters are drawn
from t, or null if there is no such class.
public static java.lang.Iterable<VariableType> allTypeParameters(DJClass c)
c, ordered outermost to innermost.
A type parameter is in scope if it belongs to a dynamically enclosing class of c.
public static java.lang.String shortName(DJClass c)
public static ClassType thisType(DJClass c)
this within the body of c
public static DJClass wrapClass(java.lang.Class<?> c)
Java5Class. Otherwise, returns a JavaClass.
public static Library classLibrary(java.lang.ClassLoader loader)
Java5Library. Otherwise, returns a JavaLibrary.
public static Type typeOfPrimitiveClass(java.lang.Class<?> c)
Class object representing a primitive type to the corresponding
Type. The class void.class is also handled.
java.lang.IllegalArgumentException - If !c.isPrimitive().
public static Type typeOfGeneralClass(java.lang.Class<?> c,
TypeSystem ts)
wrapClass(java.lang.Class>) and passing the result to TypeSystem.makeClassType(edu.rice.cs.dynamicjava.symbol.DJClass).
public static Thunk<java.lang.Class<?>> arrayClassThunk(Thunk<java.lang.Class<?>> element)
public static java.lang.Object initialValue(java.lang.Class<?> c)
null.
public static java.lang.Iterable<Type> parameterTypes(Function f)
public static boolean isVararg(Function f)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||