org.tinyjee.maven.dim.spi
Interface RequestParameterTransformer
- All Known Implementing Classes:
- AbstractAliasHandler, AbstractParameterTransformer, DirectoryLoader.AliasHandler, InlineCssParameterTransformer, InlineScriptParameterTransformer, InterfaceScanner.AliasHandler, JavaSourceLoader.AliasHandler, MacroPresetParameterTransformer, MessageBoxParameterTransformer, PropertiesLoader.AliasHandler, ScriptInvoker.AliasHandler, SvgLoader.AliasHandler, TabbedPanelParameterTransformer, TableLayoutParameterTransformer, XmlLoader.AliasHandler
public interface RequestParameterTransformer
RequestParameterTransformer
defines an interface that may be implemented and registered via service loading
to plug parameter transformers that adjust macro parameters on the fly before any other operation is triggered.
Implementation:
package my.package;
public class MyRequestParameterTransformer implements RequestParameterTransformer {
public void transformParameters(Map<String, Object> requestParams) {
Object value = requestParams.get("my-input-param");
if (value != null) {
requestParams.put("myText", value);
requestParams.put("source", "classpath:my-template.vm");
}
}
}
Register the implementation using service loading:
-
Create the following file:
META-INF/services/
org.tinyjee.maven.dim.spi.RequestParameterTransformer
- Add the fully qualified class name of your implementation to the file
"org.tinyjee.maven.dim.spi.RequestParameterTransformer":
my.package.MyRequestParameterTransformer
- Since:
- 1.0
- Version:
- 1.1
- Author:
- Juergen_Kellerer, 2010-09-08
TRANSFORMERS
static final Iterable<RequestParameterTransformer> TRANSFORMERS
- Is an iterable over all transformers within the classpath.
transformParameters
void transformParameters(Map<String,Object> requestParams)
- Transforms the specified request parameters.
- Parameters:
requestParams
- the request params to modify.