Top Description Fields Constructors Methods
org.hibernate.annotations.common.reflection.java.generics

pack-priv Class SimpleTypeEnvironment

extends HashMap<Type, Type>
implements TypeEnvironment
Class Inheritance
All Implemented Interfaces
org.hibernate.annotations.common.reflection.java.generics.TypeEnvironment
Imports
java.lang.reflect.GenericArrayType, .ParameterizedType, .Type, .TypeVariable, .WildcardType, java.util.HashMap

Binds formal type arguments (typically T, E, etc.) to actual types.
Authors
Davide Marchignoli, Paolo Perrotta

Field Summary

Modifier and TypeField and Description
private static final long
private final TypeSwitch<Type>

Constructor Summary

AccessConstructor and Description
public
SimpleTypeEnvironment(Type[] formalTypeArgs, Type[] actualTypeArgs)

Method Summary

Modifier and TypeMethod and Description
public Type
bind(Type type)

Implements org.hibernate.annotations.common.reflection.java.generics.TypeEnvironment.bind.

Binds as many generic components of the given type as possible in this context.
private Type[]
substitute(Type[] types)

Inherited from java.util.HashMap:
clearclonecomputecomputeIfAbsentcomputeIfPresentcontainsKeycontainsValueentrySetforEachgetgetOrDefaultisEmptykeySetmergenewHashMapputputAllputIfAbsentremoveremovereplacereplacereplaceAllsizevalues

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.util.HashMap.serialVersionUID.

substituteback to summary
private final TypeSwitch<Type> substitute

Constructor Detail

SimpleTypeEnvironmentback to summary
public SimpleTypeEnvironment(Type[] formalTypeArgs, Type[] actualTypeArgs)

Method Detail

bindback to summary
public Type bind(Type type)

Implements org.hibernate.annotations.common.reflection.java.generics.TypeEnvironment.bind.

Doc from org.hibernate.annotations.common.reflection.java.generics.TypeEnvironment.bind.

Binds as many generic components of the given type as possible in this context.

Warning

if the returned Type is a Class, then it's guaranteed to be a regular Java Class. In all other cases, this method might return a custom implementation of some interface that extends Type. Be sure not to mix these objects with Java's implementations of Type to avoid potential identity problems.

This class does not support bindings involving inner classes or upper/lower bounds.

Returns:Type

a type where the generic arguments have been replaced by raw classes whenever this is possible.

substituteback to summary
private Type[] substitute(Type[] types)