|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.reflect.base.AbstractGenericType<T>
T - is the templated type of the upper
bound.public abstract class AbstractGenericType<T>
This is the implementation of the GenericType interface.
| Field Summary |
|---|
| Fields inherited from interface net.sf.mmm.util.reflect.api.GenericType |
|---|
NO_TYPES |
| Constructor Summary | |
|---|---|
protected |
AbstractGenericType()
The constructor. |
| Method Summary | |
|---|---|
protected abstract GenericType<?> |
create(Type type)
This method creates the GenericType that encapsulates the given
type. |
boolean |
equals(Object other)
|
protected int |
getDeclarationIndex(TypeVariable<?> typeVariable)
This method gets the declaration-index of the given typeVariable. |
abstract GenericType<?> |
getDefiningType()
This method gets the defining type. |
protected List<Type> |
getGenericDeclarations(Class<?> ancestor,
Class<?> descendant)
This method walks up the Class-hierarchy from
descendant up to ancestor and collects the
generic super-classes or
super-interfaces of
ancestor on that hierarchy-path. |
int |
hashCode()
|
boolean |
isAssignableFrom(GenericType<?> subType)
This method determines if this GenericType is equal to or a
super-type of the given subType. |
protected Type |
resolveTypeVariable(TypeVariable<?> typeVariable,
GenericType<?> declaringType)
This method resolves the given typeVariable in the context of
the given declaringType. |
String |
toString()
This method gets the string representation of this GenericType. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface net.sf.mmm.util.reflect.api.GenericType |
|---|
getAssignmentClass, getComponentType, getKeyType, getRetrievalClass, getType, getTypeArgument, getTypeArgumentCount |
| Constructor Detail |
|---|
protected AbstractGenericType()
| Method Detail |
|---|
protected abstract GenericType<?> create(Type type)
GenericType that encapsulates the given
type.
type - is the Type to get as GenericType.
GenericType.GenericTypeFactory.createGenericType(Type)public abstract GenericType<?> getDefiningType()
Class where the type of this GenericType
was retrieved from as parameter, return-type or field-type.
null if NOT available.public final boolean equals(Object other)
equals in class Objectpublic final int hashCode()
hashCode in class Objectpublic boolean isAssignableFrom(GenericType<?> subType)
GenericType is equal to or a
super-type of the given subType.X.isAssignableFrom(Y) is true, then an
instance of Y can be casted to X.
isAssignableFrom in interface GenericType<T>subType - is the potential sub-type of this GenericType.
true if objects of the type subType can
be assigned to this GenericType.Class.isAssignableFrom(Class)
protected List<Type> getGenericDeclarations(Class<?> ancestor,
Class<?> descendant)
Class-hierarchy from
descendant up to ancestor and collects the
generic super-classes or
super-interfaces of
ancestor on that hierarchy-path.ancestor is an interface, the hierarchy may NOT be unique. In such case it will be
unspecified which of the possible paths is used.
ancestor - is the super-class or super-interface of
descendant.descendant - is the sub-class or sub-interface of
ancestor.
List of the generic super-Types from
descendant up to ancestor, where the
first element represents the super-Type of
descendant and the last element represents the generic
declaration of ancestor itself.protected int getDeclarationIndex(TypeVariable<?> typeVariable)
typeVariable.
typeVariable - is the TypeVariable.
typeVariable in its
declaration.
protected Type resolveTypeVariable(TypeVariable<?> typeVariable,
GenericType<?> declaringType)
typeVariable in the context of
the given declaringType.
typeVariable - is the TypeVariable to resolve.declaringType - is the GenericType where the given
typeVariable occurs or is replaced.
Type or null if the given
typeVariable could NOT be resolved (e.g. it was
declared in a
Class that is NOT assignable from the given declaringType) .public final String toString()
GenericType. In
case the underlying value-type is a regular
Class, this method will return its qualified
name otherwise it will return the string representation of the generic
type information (e.g.
java.util.Map<java.lang.String, java.util.List<java.lang.Integer>>[]
).
toString in interface GenericType<T>toString in class ObjectGenericType as string.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||