Home » openjdk-7 » sun.reflect.generics » factory » [javadoc | source]
public interface: GenericsFactory [javadoc | source]

All Known Implementing Classes:

A factory interface for reflective objects representing generic types. Implementors (such as core reflection or JDI, or possibly javadoc will manufacture instances of (potentially) different classes in response to invocations of the methods described here.

The intent is that reflective systems use these factories to produce generic type information on demand. Certain components of such reflective systems can be independent of a specific implementation by using this interface. For example, repositories of generic type information are initialized with a factory conforming to this interface, and use it to generate the tpe information they are required to provide. As a result, such repository code can be shared across different reflective systems.
Method from sun.reflect.generics.factory.GenericsFactory Summary:
findTypeVariable,   makeArrayType,   makeBool,   makeByte,   makeChar,   makeDouble,   makeFloat,   makeInt,   makeLong,   makeNamedType,   makeParameterizedType,   makeShort,   makeTypeVariable,   makeVoid,   makeWildcard
Method from sun.reflect.generics.factory.GenericsFactory Detail:
 public 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. Returns null otherwise.
 public Type makeArrayType(Type componentType)
    Returns a (possibly generic) array type. If the component type is a parameterized type, it must only have unbounded wildcard arguemnts, otherwise a MalformedParameterizedTypeException is thrown.
 public Type makeBool()
    Returns the reflective representation of type boolean.
 public Type makeByte()
    Returns the reflective representation of type byte.
 public Type makeChar()
    Returns the reflective representation of type char.
 public Type makeDouble()
    Returns the reflective representation of type double.
 public Type makeFloat()
    Returns the reflective representation of type float.
 public Type makeInt()
    Returns the reflective representation of type int.
 public Type makeLong()
    Returns the reflective representation of type long.
 public Type makeNamedType(String name)
 public 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. If owner is null, the declaring class of declaration is used as the owner of this parameterized type.

    This 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.

 public Type makeShort()
    Returns the reflective representation of type short.
 public TypeVariable<?> makeTypeVariable(String name,
    FieldTypeSignature[] bounds)
    Returns a new type variable declaration. Note that name may be empty (but not null). If bounds is empty, a bound of java.lang.Object is used.
 public Type makeVoid()
    Returns the reflective representation of void.
 public WildcardType makeWildcard(FieldTypeSignature[] ubs,
    FieldTypeSignature[] lbs)
    Returns a new wildcard type variable. If ubs is empty, a bound of java.lang.Object is used.