public class CoreReflectionFactory extends Object implements GenericsFactory
| Modifier and Type | Method and Description |
|---|---|
TypeVariable<?> |
findTypeVariable(String name)
Returns the type variable with name name, if such
a type variable is declared in the
scope used to create this factory.
|
static CoreReflectionFactory |
make(GenericDeclaration d,
Scope s)
Factory for this class.
|
Type |
makeArrayType(Type componentType)
Returns a (possibly generic) array type.
|
Type |
makeBool()
Returns the reflective representation of type boolean.
|
Type |
makeByte()
Returns the reflective representation of type byte.
|
Type |
makeChar()
Returns the reflective representation of type char.
|
Type |
makeDouble()
Returns the reflective representation of type double.
|
Type |
makeFloat()
Returns the reflective representation of type float.
|
Type |
makeInt()
Returns the reflective representation of type int.
|
Type |
makeLong()
Returns the reflective representation of type long.
|
Type |
makeNamedType(String name) |
ParameterizedType |
makeParameterizedType(Type declaration,
Type[] typeArgs,
Type owner)
Return an instance of the ParameterizedType interface
that corresponds to a generic type instantiation of the
generic declaration declaration with actual type arguments
typeArgs.
|
Type |
makeShort()
Returns the reflective representation of type short.
|
TypeVariable<?> |
makeTypeVariable(String name,
FieldTypeSignature[] bounds)
Returns a new type variable declaration.
|
Type |
makeVoid()
Returns the reflective representation of void.
|
WildcardType |
makeWildcard(FieldTypeSignature[] ubs,
FieldTypeSignature[] lbs)
Returns a new wildcard type variable.
|
public static CoreReflectionFactory make(GenericDeclaration d, Scope s)
Type variables will be created or lookup as necessary in the scope s.
d - - the generic declaration (class, interface, method or
constructor) that thsi factory servicess - the scope in which the factory will allocate and search for
type variablespublic TypeVariable<?> makeTypeVariable(String name, FieldTypeSignature[] bounds)
GenericsFactorymakeTypeVariable in interface GenericsFactoryname - The name of the type variablebounds - An array of abstract syntax trees representing
the upper bound(s) on the type variable being declaredpublic WildcardType makeWildcard(FieldTypeSignature[] ubs, FieldTypeSignature[] lbs)
GenericsFactorymakeWildcard in interface GenericsFactoryubs - An array of abstract syntax trees representing
the upper bound(s) on the type variable being declaredlbs - An array of abstract syntax trees representing
the lower bound(s) on the type variable being declaredpublic ParameterizedType makeParameterizedType(Type declaration, Type[] typeArgs, Type owner)
GenericsFactoryThis method throws a MalformedParameterizedTypeException under the following circumstances: If the type declaration does not represent a generic declaration (i.e., it is not an instance of GenericDeclaration). If the number of actual type arguments (i.e., the size of the array typeArgs) does not correspond to the number of formal type arguments. If any of the actual type arguments is not an instance of the bounds on the corresponding formal.
makeParameterizedType in interface GenericsFactorydeclaration - - the generic type declaration that is to be
instantiatedtypeArgs - - the list of actual type argumentspublic TypeVariable<?> findTypeVariable(String name)
GenericsFactoryfindTypeVariable in interface GenericsFactoryname - - the name of the type variable to search forpublic Type makeNamedType(String name)
makeNamedType in interface GenericsFactorypublic Type makeArrayType(Type componentType)
GenericsFactorymakeArrayType in interface GenericsFactorycomponentType - - the component type of the arraypublic Type makeByte()
GenericsFactorymakeByte in interface GenericsFactorypublic Type makeBool()
GenericsFactorymakeBool in interface GenericsFactorypublic Type makeShort()
GenericsFactorymakeShort in interface GenericsFactorypublic Type makeChar()
GenericsFactorymakeChar in interface GenericsFactorypublic Type makeInt()
GenericsFactorymakeInt in interface GenericsFactorypublic Type makeLong()
GenericsFactorymakeLong in interface GenericsFactorypublic Type makeFloat()
GenericsFactorymakeFloat in interface GenericsFactorypublic Type makeDouble()
GenericsFactorymakeDouble in interface GenericsFactorypublic Type makeVoid()
GenericsFactorymakeVoid in interface GenericsFactory