|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.misc.Pipeline
public final class Pipeline
A class for chaining multiple transformations into a single model without having to nest <transform> tags. A slightly more elegant way to handle transformation pipelines.
Transformations are called from leftmost argument to rightmost in order. This differs from nesting <transform> tags where the innermost is called first, and the outermost is called last.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "pipeline", freemarker.ext.misc.Pipeline.getInstance() ); ...
From your FM-Classic template:
The following is transformed with a pipeline: <transform pipeline( transform1, transform2, transform3, transform4 )> This output is transformed by all the transformations in the pipeline. </transform> ...
In the example, the transformations are applied in the following order:
Source => Transform 1 => Transform 2 => Transform 3 => Transform 4 = > Output
Note:
Pipeline
is a singleton instance. Use the
getInstance()
method to retrieve instances of this model.
Method Summary | |
---|---|
TemplateModel |
exec(java.util.List<TemplateModel> arguments)
Construct a new transform pipeline with the given transform models. |
static Pipeline |
getInstance()
Return a new instance of this class. |
boolean |
isEmpty()
Is the current method model empty. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Pipeline getInstance()
public boolean isEmpty()
isEmpty
in interface TemplateModel
false
, indicating that this method model is not
emptypublic TemplateModel exec(java.util.List<TemplateModel> arguments) throws TemplateModelException
exec
in interface TemplateMethodModel2
arguments
- a List of TemplateTransformModel or
TemplateTransformModel2 models to be chained into a single pipeline
TemplateModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |