| java.lang.Object org.directwebremoting.fluent.FluentConfigurator
All known Subclasses: org.getahead.dwrdemo.fluent.DemoFluentConfigurator,
FluentConfigurator | abstract public class FluentConfigurator implements Configurator(Code) | | A
Configurator that used the FluentInterface style as
described by
Martin Fowler.
To wire up the configuration programmatically rather than having to use
dwr.xml . In order to use this style, you'll need to:
The implementation of
FluentConfigurator.configure() will look something like
this:
public void configure() {
withConverterType("dog", "com.yourcompany.beans.Dog");
withCreatorType("ejb", "com.yourcompany.dwr.creator.EJBCreator");
withCreator("new", "ApartmentDAO")
.addParam("scope", "session")
.addParam("class", "com.yourcompany.dao.ApartmentDAO")
.exclude("saveApartment")
.withAuth("method", "role");
withCreator("struts", "DogDAO")
.addParam("clas", "com.yourcompany.dao.DogDAO")
.include("getDog")
.include("getColor");
withConverter("dog", "*.Dog")
.addParam("name", "value");
withSignature()
.addLine("import java.util.List;")
.addLine("import com.example.Check;")
.addLine("Check.setLotteryResults(List nos);");
}
author: Aaron Johnson [ajohnson at cephas dot net / http://cephas.net/blog] author: Joe Walker [joe at getahead dot ltd dot uk] |
Method Summary | |
public FluentConfigurator | addFilter(String newFilterClassName) Add a filter to whatever is being configured. | public FluentConfigurator | addLine(String line) Add lines to a signature. | public FluentConfigurator | addParam(String name, String value) Add a parameter to whatever is being configured. | abstract public void | configure() This method is used to configure DWR using the fluent style. | public void | configure(Container container) | public FluentConfigurator | exclude(String methodName) Add an exclude rule to a
Creator This should be used during a
FluentConfigurator.withCreator(String,String) call. | public FluentConfigurator | include(String methodName) Add an include rule to a
Creator . | public FluentConfigurator | withAuth(String methodName, String role) Add an authorization rule to a
Creator This should be used during a
FluentConfigurator.withCreator(String,String) call. | public FluentConfigurator | withConverter(String newConverter, String newMatch) | public FluentConfigurator | withConverterType(String id, String converterClassName) Add a new
Converter definition.
Parameters: id - The id referred to by the FluentConfigurator.withConverter(String,String) Parameters: converterClassName - The implementation of Converter to instantiate. | public FluentConfigurator | withCreator(String newTypeName, String newScriptName) | public FluentConfigurator | withCreatorType(String id, String creatorClassName) Add a new
Creator definition.
Parameters: id - The id referred to by the FluentConfigurator.withCreator(String,String) Parameters: creatorClassName - The implementation of Creator to instantiate. | public FluentConfigurator | withFilter(String newFilterClassName) | public FluentConfigurator | withSignature() Add lines to a signature. |
addFilter | public FluentConfigurator addFilter(String newFilterClassName)(Code) | | Add a filter to whatever is being configured.
Parameters: newFilterClassName - The class to add as a filter this to continue the fluency |
addLine | public FluentConfigurator addLine(String line)(Code) | | Add lines to a signature.
Parameters: line - The line of text to add to the signature configuration this to continue the fluency |
addParam | public FluentConfigurator addParam(String name, String value)(Code) | | Add a parameter to whatever is being configured.
Parameters: name - The name of the parameter Parameters: value - The value of the parameter this to continue the fluency |
configure | abstract public void configure()(Code) | | This method is used to configure DWR using the fluent style.
|
withFilter | public FluentConfigurator withFilter(String newFilterClassName)(Code) | | Parameters: newFilterClassName - filter class name this to continue the fluency |
|
|