org.apache.geronimo.blueprint.container
Class GenericType
java.lang.Object
org.osgi.service.blueprint.container.ReifiedType
org.apache.geronimo.blueprint.container.GenericType
public class GenericType
- extends ReifiedType
XXXX: Currently, in case of arrays getActualTypeArgument(0) returns something similar to what
Class.getComponentType() does for arrays. I don't think this is quite right since getActualTypeArgument()
should return the given parameterized type not the component type. Need to check this behavior with the spec.
GenericType
public GenericType(Type type)
GenericType
public GenericType(Class clazz,
GenericType... parameters)
parse
public static GenericType parse(String type,
Object loader)
throws ClassNotFoundException,
IllegalArgumentException
- Throws:
ClassNotFoundException
IllegalArgumentException
getActualTypeArgument
public ReifiedType getActualTypeArgument(int i)
- Description copied from class:
ReifiedType
- Return a type parameter for this type.
The type parameter refers to a parameter in a generic type declaration
given by the zero-based index
i.
For example, in the following example:
Map<String, ? extends Metadata>
type parameter 0 is String, and type parameter 1 is
Metadata.
This implementation returns a Reified Type that has Object
as class. Any object is assignable to Object and therefore no conversion
is then necessary. This is compatible with versions of Java language
prior to Java 5.
This method should be overridden by a subclass that provides access to
the generic type parameter information for Java 5 and later.
- Overrides:
getActualTypeArgument in class ReifiedType
- Parameters:
i - The zero-based index of the requested type parameter.
- Returns:
- The
ReifiedType for the generic type parameter at
the specified index.
size
public int size()
- Description copied from class:
ReifiedType
- Return the number of type parameters for this type.
This implementation returns 0. This method should be
overridden by a subclass that provides access to the generic type
parameter information for Java 5 and later.
- Overrides:
size in class ReifiedType
- Returns:
- The number of type parameters for this type.
toString
public String toString()
- Overrides:
toString in class Object
equals
public boolean equals(Object object)
- Overrides:
equals in class Object
Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.