private void processSite(InjectingComponentType componentType, String name, Member member, Class<?> parameterType, Class<?> declaringClass, InjectionSite site, IntrospectionContext context) { TypeMapping typeMapping = context.getTypeMapping(declaringClass); InjectableType type = helper.inferType(parameterType, typeMapping); switch (type) { case PROPERTY: addProperty(componentType, name, parameterType, declaringClass, site, context); break; case REFERENCE: addReference(componentType, name, parameterType, declaringClass, site, context); break; case CALLBACK: context.addError(new UnknownInjectionType(site, type, componentType.getImplClass().getName(), member, componentType)); break; default: context.addError(new UnknownInjectionType(site, type, componentType.getImplClass().getName(), member, componentType)); } }
private void processSite(InjectingComponentType componentType, TypeMapping typeMapping, String name, Member member, Type parameterType, InjectionSite site, IntrospectionContext context) { InjectableType type = helper.inferType(parameterType, typeMapping); switch (type) { case PROPERTY: addProperty(componentType, typeMapping, name, parameterType, site); break; case REFERENCE: addReference(componentType, typeMapping, name, parameterType, site, context); break; default: String clazz = componentType.getImplClass().getName(); UnknownInjectionType error = new UnknownInjectionType(site, type, clazz, member, componentType); context.addError(error); } }
componentType.addMapping(tempType.getImplClass().getName(), entry.getKey(), entry.getValue());
public void introspect(InjectingComponentType componentType, IntrospectionContext context) { componentType.setScope(Scope.COMPOSITE); Class<?> implClass = componentType.getImplClass(); if (implClass.isInterface()) { InvalidImplementation failure = new InvalidImplementation("Implementation class is an interface", implClass, componentType); context.addError(failure); return; } TypeMapping mapping = context.getTypeMapping(implClass); if (mapping == null) { mapping = new TypeMapping(); context.addTypeMapping(implClass, mapping); helper.resolveTypeParameters(implClass, mapping); } classVisitor.visit(componentType, implClass, context); heuristic.applyHeuristics(componentType, implClass, context); } }
public void introspect(InjectingComponentType componentType, IntrospectionContext context) { componentType.setScope(Scope.STATELESS); Class<?> implClass = componentType.getImplClass(); if (implClass.isInterface()) { InvalidImplementation failure = new InvalidImplementation("Implementation class is an interface", implClass, componentType); context.addError(failure); return; } TypeMapping mapping = context.getTypeMapping(implClass); if (mapping == null) { mapping = new TypeMapping(); context.addTypeMapping(implClass, mapping); helper.resolveTypeParameters(implClass, mapping); } try { classVisitor.visit(componentType, implClass, context); heuristic.applyHeuristics(componentType, implClass, context); } catch (NoClassDefFoundError e) { // May be thrown as a result of a referenced class not being on the classpath context.addError(new ImplementationArtifactNotFound(implClass.getName(), e.getMessage(), componentType)); } validateScope(componentType, implClass, context); for (PostProcessor postProcessor : postProcessors) { postProcessor.process(componentType, implClass, context); } }