public void applyHeuristics(InjectingComponentType componentType, Class<?> implClass, IntrospectionContext context) { // if there is already a defined constructor then do nothing if (componentType.getConstructor() != null) { return; } Constructor<?> ctor = findConstructor(implClass, componentType, context); componentType.setConstructor(ctor); }
public void applyHeuristics(InjectingComponentType componentType, Class<?> implClass, IntrospectionContext context) { // apply service heuristic serviceHeuristic.applyHeuristics(componentType, implClass, context); if (componentType.getConstructor() == null) { Constructor<?> ctor = findConstructor(implClass, componentType, context); componentType.setConstructor(ctor); } if (componentType.getProperties().isEmpty() && componentType.getReferences().isEmpty() && componentType.getResourceReferences().isEmpty()) { evaluateConstructor(componentType, implClass, context); evaluateSetters(componentType, implClass, context); evaluateFields(componentType, implClass, context); } Scope scope = componentType.getScope(); if (componentType.isManaged() && !scope.isSingleton()) { IllegalManagementAttribute warning = new IllegalManagementAttribute(implClass, componentType); context.addWarning(warning); } }