Package org.jboss.weld.util.reflection
Class EventObjectTypeResolverBuilder
- java.lang.Object
-
- org.jboss.weld.util.reflection.EventObjectTypeResolverBuilder
-
public class EventObjectTypeResolverBuilder extends Object
Builds a specialTypeResolver
capable of resolving type variables by using a combination of two type hierarchies. The special resolver is only necessary for situations where the type of the event object contains an unresolved type variable which cannot be resolved using the selected event type because the selected event type is a subtype of the event object. For example: private Event- > event;
event.fire(new ArrayList
()); The event object type is ArrayList
(raw type due to type erasure) The selected type is ListWe cannot simply infer the correct type (ArrayList ) from the runtime type nor from the selected type. What this special resolver does is that it combines the following type variable assignments: L -> E L -> String and resolves E to String. The resolver is capable of doing it recursively for parameterized types. - Author:
- Jozef Hartinger
-
-
Constructor Summary
Constructors Constructor Description EventObjectTypeResolverBuilder(Map<TypeVariable<?>,Type> selectedTypeVariables, Map<TypeVariable<?>,Type> eventTypeVariables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TypeResolver
build()
Map<TypeVariable<?>,Type>
getResolvedTypes()
protected void
resolveTypeVariables()
protected void
resolveTypeVariables(ParameterizedType type1, Type type2)
protected void
resolveTypeVariables(Type type1, Type type2)
protected void
resolveTypeVariables(TypeVariable<?> type1, Type type2)
-
-
-
Constructor Detail
-
EventObjectTypeResolverBuilder
public EventObjectTypeResolverBuilder(Map<TypeVariable<?>,Type> selectedTypeVariables, Map<TypeVariable<?>,Type> eventTypeVariables)
-
-
Method Detail
-
build
public TypeResolver build()
-
resolveTypeVariables
protected void resolveTypeVariables()
-
resolveTypeVariables
protected void resolveTypeVariables(TypeVariable<?> type1, Type type2)
-
resolveTypeVariables
protected void resolveTypeVariables(ParameterizedType type1, Type type2)
-
getResolvedTypes
public Map<TypeVariable<?>,Type> getResolvedTypes()
-
-