|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.misc.Perl5Translate
public final class Perl5Translate
Perform Perl 5 translation using the JTR library. A list of translate expressions is passed in, and executed in order on a line-by-line basis. The result of this transformation is always terminated by a newline sequence.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "translate", freemarker.ext.misc.Perl5Translate.getInstance() ); ...
From your FM-Classic template:
The following removes all duplicate spaces: <transform translate( "tr/ //s" )> This paragraph has all excess spaces removed. </transform> ...
Note:
Perl5Translate
is a singleton instance. Use the
getInstance()
method to retrieve instances of this model.
Method Summary | |
---|---|
TemplateModel |
exec(java.util.List<java.lang.String> arguments)
Executes a method call. |
static Perl5Translate |
getInstance()
Return a new instance of this class. |
boolean |
isEmpty()
Is the object empty? |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Perl5Translate getInstance()
public boolean isEmpty() throws TemplateModelException
TemplateModel
isEmpty
in interface TemplateModel
true
if this object is empty, otherwise false
TemplateModelException
public TemplateModel exec(java.util.List<java.lang.String> arguments) throws TemplateModelException
TemplateMethodModel
List
of
String
objects.
exec
in interface TemplateMethodModel
arguments
- a List
of String
objects
containing the values of the arguments passed to the method.
TemplateModel
produced by the method, or null
.
TemplateModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |