|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.webflow.definition.registry.ExternalizedFlowDefinitionRegistrar
public abstract class ExternalizedFlowDefinitionRegistrar
A flow definition registrar that populates a flow definition registry from flow definitions defined within externalized resources. Encapsulates registration behavior common to all externalized registrars and is not tied to a specific flow definition format (e.g. xml).
Concrete subclasses are expected to derive from this class to provide knowledge about a particular kind of definition format by implementing the abstract template methods in this class.
By default, when configuring the locations
property, flow definitions at those
locations will be assigned a registry identifier equal to the filename of the underlying definition resource, minus
the filename extension. For example, a XML-based flow definition defined in the file "flow1.xml" will be identified
as "flow1" when registered in a registry.
For full control over the assignment of flow identifiers and flow properties, configure formal
FlowDefinitionResource
instances using the
setResources(FlowDefinitionResource[] resources)
property.
FlowDefinitionResource
,
FlowDefinitionRegistry
Constructor Summary | |
---|---|
ExternalizedFlowDefinitionRegistrar()
|
Method Summary | |
---|---|
boolean |
addLocation(org.springframework.core.io.Resource location)
Adds a flow location pointing to an externalized flow resource. |
boolean |
addLocations(org.springframework.core.io.Resource[] locations)
Adds the flow locations pointing to externalized flow resources. |
boolean |
addResource(FlowDefinitionResource resource)
Adds an externalized flow definition specification pointing to an externalized flow resource. |
boolean |
addResources(FlowDefinitionResource[] resources)
Adds the externalized flow definitions pointing to externalized flow resources. |
protected abstract FlowDefinitionHolder |
createFlowDefinitionHolder(FlowDefinitionResource resource)
Template factory method subclasses must override to return the holder for the flow definition to be registered loaded from the specified resource. |
protected FlowDefinitionResource |
createFlowDefinitionResource(org.springframework.core.io.Resource location)
Factory method that creates a flow definition from an externalized resource location. |
protected boolean |
isFlowDefinitionResource(org.springframework.core.io.Resource resource)
Template method that calculates if the given file resource is actually a flow definition resource. |
protected void |
register(FlowDefinitionResource resource,
FlowDefinitionRegistry registry)
Helper method to register the flow built from an externalized resource in the registry. |
void |
registerFlowDefinitions(FlowDefinitionRegistry registry)
Register flow definition resources managed by this registrar in the registry provided. |
void |
setLocations(org.springframework.core.io.Resource[] locations)
Sets the locations (file paths) pointing to externalized flow definitions. |
void |
setResources(FlowDefinitionResource[] resources)
Sets the formal set of externalized flow definitions this registrar will register. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ExternalizedFlowDefinitionRegistrar()
Method Detail |
---|
public void setLocations(org.springframework.core.io.Resource[] locations)
Flows registered from this set will be automatically assigned an id based on the filename of the flow resource.
locations
- the resource locationspublic void setResources(FlowDefinitionResource[] resources)
Use this method when you want full control over the assigned flow id and the set of properties applied to the externalized flow resources.
resources
- the externalized flow definition specificationspublic boolean addLocation(org.springframework.core.io.Resource location)
The flow registered from this location will automatically assigned an id based on the filename of the flow resource.
location
- the definition locationpublic boolean addLocations(org.springframework.core.io.Resource[] locations)
The flow registered from this location will automatically assigned an id based on the filename of the flow resource.
locations
- the definition locationspublic boolean addResource(FlowDefinitionResource resource)
Use this method when you want full control over the assigned flow id and the set of properties applied to the externalized flow resource.
resource
- the definition the definition resourcepublic boolean addResources(FlowDefinitionResource[] resources)
Use this method when you want full control over the assigned flow id and the set of properties applied to the externalized flow resources.
resources
- the definitionspublic void registerFlowDefinitions(FlowDefinitionRegistry registry)
FlowDefinitionRegistrar
registerFlowDefinitions
in interface FlowDefinitionRegistrar
registry
- the registry to register flow definitions inprotected final void register(FlowDefinitionResource resource, FlowDefinitionRegistry registry)
resource
- representation of the externalized flow definition resourceregistry
- the flow registry to register the flow inprotected boolean isFlowDefinitionResource(org.springframework.core.io.Resource resource)
resource
- the underlying resource
protected FlowDefinitionResource createFlowDefinitionResource(org.springframework.core.io.Resource location)
location
- the location of the resource
protected abstract FlowDefinitionHolder createFlowDefinitionHolder(FlowDefinitionResource resource)
resource
- the externalized resource
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |