public void init(FlowBuilderContext context) throws FlowBuilderException { this.context = context; doInit(); flow = createFlow(); }
public void dispose() throws FlowBuilderException { flow = null; doDispose(); }
public ValidationHintResolver getValidationHintResolver() { return flowBuilderServices.getValidationHintResolver(); }
/** * Create and return a {@link FlowBuilderServices} instance. */ public FlowBuilderServices build() { FlowBuilderServices flowBuilderServices = new FlowBuilderServices(); flowBuilderServices.setConversionService(this.conversionService); flowBuilderServices.setExpressionParser(getExpressionParser()); flowBuilderServices.setViewFactoryCreator(this.viewFactoryCreator); flowBuilderServices.setValidator(this.validator); flowBuilderServices.setValidationHintResolver(this.validationHintResolver); flowBuilderServices.setDevelopment(this.enableDevelopmentMode); return flowBuilderServices; }
public ConversionExecutor getConversionExecutor(Class<?> sourceClass, Class<?> targetClass) throws ConversionExecutionException { return getFlowBuilderServices().getConversionService().getConversionExecutor(sourceClass, targetClass); }
/** * Factory method that creates the conversion service the flow builder will use. Subclasses may override. The * default implementation registers Web Flow-specific converters thought to be useful for most builder * implementations, setting the externally-provided builder services conversion service as its parent. * @return the flow builder conversion service */ protected ConversionService createConversionService() { GenericConversionService service = new GenericConversionService( getFlowBuilderServices().getConversionService().getDelegateConversionService()); service.addConverter(new TextToTransitionCriteria(this)); service.addConverter(new TextToTargetStateResolver(this)); service.setParent(new ParentConversionServiceProxy()); return service; }
public ViewFactoryCreator getViewFactoryCreator() { return flowBuilderServices.getViewFactoryCreator(); }
public ExpressionParser getExpressionParser() { return flowBuilderServices.getExpressionParser(); }
public Validator getValidator() { return flowBuilderServices.getValidator(); }
private Class<?> fromStringToClass(String name) { Class<?> clazz = flowBuilderServices.getConversionService().getClassForAlias(name); if (clazz != null) { return clazz; } else { return loadClass(name); } }
public ApplicationContext getApplicationContext() { return flowBuilderServices.getApplicationContext(); }
/** * Creates a new flow builder context. * @param flowId the id to assign the flow being built * @param flowAttributes attributes to assign the flow being built * @param flowDefinitionLocator a locator to find dependent subflows * @param flowBuilderServices a parameter object providing access to additional services needed by the flow builder */ public FlowBuilderContextImpl(String flowId, AttributeMap<Object> flowAttributes, FlowDefinitionLocator flowDefinitionLocator, FlowBuilderServices flowBuilderServices) { Assert.hasText(flowId, "The flow id is required"); Assert.notNull(flowDefinitionLocator, "The flow definition locator is required"); Assert.notNull(flowBuilderServices, "The flow builder services holder is required"); this.flowId = flowId; initFlowAttributes(flowAttributes); this.flowDefinitionLocator = flowDefinitionLocator; this.flowBuilderServices = flowBuilderServices; this.conversionService = createConversionService(); }
private void updateFlowAttributes(AttributeMap<Object> attributes) { if (this.flowBuilderServices.getDevelopment()) { attributes.asMap().put("development", true); } }
/** * Factory method that initially creates the flow implementation during flow builder initialization. Simply * delegates to the configured flow artifact factory by default. * @return the flow instance, initially created but not yet built */ protected Flow createFlow() { String id = getContext().getFlowId(); AttributeMap<Object> attributes = getContext().getFlowAttributes(); return getContext().getFlowArtifactFactory().createFlow(id, attributes); }
public FlowArtifactFactory getFlowArtifactFactory() { return flowBuilderServices.getFlowArtifactFactory(); }
public org.springframework.core.convert.ConversionService getDelegateConversionService() { return getFlowBuilderServices().getConversionService().getDelegateConversionService(); } }
public ConversionExecutor getConversionExecutor(String id, Class<?> sourceClass, Class<?> targetClass) throws ConversionExecutorNotFoundException { return getFlowBuilderServices().getConversionService().getConversionExecutor(id, sourceClass, targetClass); }
public Class<?> getClassForAlias(String name) { return getFlowBuilderServices().getConversionService().getClassForAlias(name); }
public Object executeConversion(Object source, Class<?> targetClass) throws ConversionException { return getFlowBuilderServices().getConversionService().executeConversion(source, targetClass); }
public Object executeConversion(String converterId, Object source, Class<?> targetClass) { return getFlowBuilderServices().getConversionService().executeConversion(converterId, source, targetClass); }