protected Statement generateFactoryHandleStatement(final Injectable injectable) { final Statement newObject; if (injectable.getInjectedType().isAnnotationPresent(ActivatedBy.class)) { final Class<? extends BeanActivator> activatorType = injectable.getInjectedType().getAnnotation(ActivatedBy.class).value(); newObject = newObject(FactoryHandleImpl.class, loadLiteral(injectable.getInjectedType()), injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()), injectable.getBeanName(), !injectable.isContextual(), loadLiteral(activatorType)); } else { newObject = newObject(FactoryHandleImpl.class, loadLiteral(injectable.getInjectedType()), injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()), injectable.getBeanName(), !injectable.isContextual()); } return newObject; }
@Override protected Statement generateFactoryHandleStatement(final Injectable injectable) { final Object[] args; if (injectable.getInjectedType().isAnnotationPresent(ActivatedBy.class)) { final Class<? extends BeanActivator> activatorType = injectable.getInjectedType().getAnnotation(ActivatedBy.class).value(); args = new Object[] { loadLiteral(injectable.getInjectedType()), injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()), injectable.getBeanName(), loadLiteral(false), loadLiteral(activatorType) }; } else { args = new Object[] { loadLiteral(injectable.getInjectedType()), injectable.getFactoryName(), injectable.getScope(), isEager(injectable.getInjectedType()), injectable.getBeanName(), loadLiteral(false) }; } return newObject(FactoryHandleImpl.class, args); }
private Statement generateFactoryHandle(final Injectable injectable, @SuppressWarnings("rawtypes") final BlockBuilder curMethod) { final String handleVarName = "handleFor" + injectable.getFactoryName(); curMethod.append(declareFinalVariable(handleVarName, FactoryHandleImpl.class, ObjectBuilder.newInstanceOf(FactoryHandleImpl.class) .withParameters(loadLiteral(injectable.getInjectedType()), loadLiteral(injectable.getFactoryName()), loadLiteral(injectable.getScope()), loadLiteral(false), loadLiteral(injectable.getBeanName()), loadLiteral(!injectable.isContextual())))); curMethod.append(loadVariable(handleVarName).invoke("setAssignableTypes", getAssignableTypesArrayStmt(injectable))); if (!injectable.getQualifier().isDefaultQualifier()) { curMethod.append(loadVariable(handleVarName).invoke("setQualifiers", getAnnotationArrayStmt(injectable.getQualifier()))); } return loadVariable(handleVarName); }