Refine search
public TypeResolver build() { resolveTypeVariables(); Map<TypeVariable<?>, Type> mergedVariables = new HashMap<TypeVariable<?>, Type>(eventTypeVariables); mergedVariables.putAll(selectedTypeVariables); mergedVariables.putAll(resolvedTypes); return new TypeResolver(mergedVariables); }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); }
public Type resolveType(Type type) { if (type instanceof ParameterizedType) { return resolveType((ParameterizedType) type); } if (type instanceof TypeVariable<?>) { return resolveType((TypeVariable<?>) type); } if (type instanceof GenericArrayType) { return resolveType((GenericArrayType) type); } return type; }
protected Type getEventType(Class<?> runtimeType) { Type resolvedType = runtimeType; if (Types.containsTypeVariable(resolvedType)) { /* * If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. */ resolvedType = injectionPointTypeHierarchy.resolveType(resolvedType); } if (Types.containsTypeVariable(resolvedType)) { /* * Examining the hierarchy of the specified type did not help. This may still be one of the cases when combining the * event type and the specified type reveals the actual values for type variables. Let's try that. */ Type canonicalEventType = Types.getCanonicalType(runtimeType); TypeResolver objectTypeResolver = new EventObjectTypeResolverBuilder(injectionPointTypeHierarchy.getResolver() .getResolvedTypeVariables(), new HierarchyDiscovery(canonicalEventType).getResolver() .getResolvedTypeVariables()).build(); resolvedType = objectTypeResolver.resolveType(canonicalEventType); } return resolvedType; }
/** * Constructs a new {@link HierarchyDiscovery} instance. * @param type the type whose hierarchy will be discovered */ public HierarchyDiscovery(Type type) { this(type, new TypeResolver(new HashMap<TypeVariable<?>, Type>())); }
protected Type getEventType(Class<?> runtimeType) { Type resolvedType = runtimeType; if (Types.containsTypeVariable(resolvedType)) { /* * If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. */ resolvedType = injectionPointTypeHierarchy.resolveType(resolvedType); } if (Types.containsTypeVariable(resolvedType)) { /* * Examining the hierarchy of the specified type did not help. This may still be one of the cases when combining the * event type and the specified type reveals the actual values for type variables. Let's try that. */ Type canonicalEventType = Types.getCanonicalType(runtimeType); TypeResolver objectTypeResolver = new EventObjectTypeResolverBuilder(injectionPointTypeHierarchy.getResolver() .getResolvedTypeVariables(), new HierarchyDiscovery(canonicalEventType).getResolver() .getResolvedTypeVariables()).build(); resolvedType = objectTypeResolver.resolveType(canonicalEventType); } return resolvedType; }
/** * Constructs a new {@link HierarchyDiscovery} instance. * @param type the type whose hierarchy will be discovered */ public HierarchyDiscovery(Type type) { this(type, new TypeResolver(new HashMap<TypeVariable<?>, Type>())); }
protected Type getEventType(Class<?> runtimeType) { Type resolvedType = runtimeType; if (Types.containsTypeVariable(resolvedType)) { /* * If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. */ resolvedType = injectionPointTypeHierarchy.resolveType(resolvedType); } if (Types.containsTypeVariable(resolvedType)) { /* * Examining the hierarchy of the specified type did not help. This may still be one of the cases when combining the * event type and the specified type reveals the actual values for type variables. Let's try that. */ Type canonicalEventType = Types.getCanonicalType(runtimeType); TypeResolver objectTypeResolver = new EventObjectTypeResolverBuilder(injectionPointTypeHierarchy.getResolver() .getResolvedTypeVariables(), new HierarchyDiscovery(canonicalEventType).getResolver() .getResolvedTypeVariables()).build(); resolvedType = objectTypeResolver.resolveType(canonicalEventType); } return resolvedType; }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
public TypeResolver build() { resolveTypeVariables(); Map<TypeVariable<?>, Type> mergedVariables = new HashMap<TypeVariable<?>, Type>(eventTypeVariables); mergedVariables.putAll(selectedTypeVariables); mergedVariables.putAll(resolvedTypes); return new TypeResolver(mergedVariables); }
public Type resolveType(Type type) { if (type instanceof ParameterizedType) { return resolveType((ParameterizedType) type); } if (type instanceof TypeVariable<?>) { return resolveType((TypeVariable<?>) type); } if (type instanceof GenericArrayType) { return resolveType((GenericArrayType) type); } return type; }
/** * Constructs a new {@link HierarchyDiscovery} instance. * @param type the type whose hierarchy will be discovered */ public HierarchyDiscovery(Type type) { this(type, new TypeResolver(new HashMap<TypeVariable<?>, Type>())); }
protected Type getEventType(Class<?> runtimeType) { Type resolvedType = runtimeType; if (Types.containsTypeVariable(resolvedType)) { /* * If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. */ resolvedType = injectionPointTypeHierarchy.resolveType(resolvedType); } if (Types.containsTypeVariable(resolvedType)) { /* * Examining the hierarchy of the specified type did not help. This may still be one of the cases when combining the * event type and the specified type reveals the actual values for type variables. Let's try that. */ Type canonicalEventType = Types.getCanonicalType(runtimeType); TypeResolver objectTypeResolver = new EventObjectTypeResolverBuilder(injectionPointTypeHierarchy.getResolver() .getResolvedTypeVariables(), new HierarchyDiscovery(canonicalEventType).getResolver() .getResolvedTypeVariables()).build(); resolvedType = objectTypeResolver.resolveType(canonicalEventType); } return resolvedType; }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
public TypeResolver build() { resolveTypeVariables(); Map<TypeVariable<?>, Type> mergedVariables = new HashMap<TypeVariable<?>, Type>(eventTypeVariables); mergedVariables.putAll(selectedTypeVariables); mergedVariables.putAll(resolvedTypes); return new TypeResolver(mergedVariables); }
public Type resolveType(Type type) { if (type instanceof ParameterizedType) { return resolveType((ParameterizedType) type); } if (type instanceof TypeVariable<?>) { return resolveType((TypeVariable<?>) type); } if (type instanceof GenericArrayType) { return resolveType((GenericArrayType) type); } return type; }
/** * Constructs a new {@link HierarchyDiscovery} instance. * @param type the type whose hierarchy will be discovered */ public HierarchyDiscovery(Type type) { this(type, new TypeResolver(new HashMap<TypeVariable<?>, Type>())); }
protected Type getEventType(Class<?> runtimeType) { Type resolvedType = runtimeType; if (Types.containsTypeVariable(resolvedType)) { /* * If the container is unable to resolve the parameterized type of the event object, it uses the specified type to infer the parameterized type of the event types. */ resolvedType = injectionPointTypeHierarchy.resolveType(resolvedType); } if (Types.containsTypeVariable(resolvedType)) { /* * Examining the hierarchy of the specified type did not help. This may still be one of the cases when combining the * event type and the specified type reveals the actual values for type variables. Let's try that. */ Type canonicalEventType = Types.getCanonicalType(runtimeType); TypeResolver objectTypeResolver = new EventObjectTypeResolverBuilder(injectionPointTypeHierarchy.getResolver() .getResolvedTypeVariables(), new HierarchyDiscovery(canonicalEventType).getResolver() .getResolvedTypeVariables()).build(); resolvedType = objectTypeResolver.resolveType(canonicalEventType); } return resolvedType; }
public HierarchyDiscovery(Type type, TypeResolver resolver) { this.types = new HashMap<Class<?>, Type>(); this.resolver = resolver; this.resolvedTypeVariables = resolver.getResolvedTypeVariables(); discoverTypes(type, false); this.typeClosure = ImmutableSet.copyOf(types.values()); }
public TypeResolver build() { resolveTypeVariables(); Map<TypeVariable<?>, Type> mergedVariables = new HashMap<TypeVariable<?>, Type>(eventTypeVariables); mergedVariables.putAll(selectedTypeVariables); mergedVariables.putAll(resolvedTypes); return new TypeResolver(mergedVariables); }