|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfreemarker.ext.misc.Translate
public class Translate
A method model that implements the Perl 5 translate function. This uses the JTR library to perform the translation.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "translate", new freemarker.ext.misc.Translate() ); ...
From your FM-Classic template:
The following is stripped of all duplicate spaces: <assign text = " This paragraph has all excess spaces removed."> <assign output = translate( "tr/ //s", text )> ${output} The result is ${output.result}, the number of matches was ${output.matches}. ...
Note:
Translate
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 Translate |
getInstance()
Retrieve a singleton 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 Translate getInstance()
Translate
classpublic 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 |