|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.ext.misc.Translate
public final 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}.
...
| Constructor Summary | |
|---|---|
Translate()
|
|
| Method Summary | |
|---|---|
TemplateModel |
exec(java.util.List<java.lang.String> arguments)
Executes a method call. |
boolean |
isEmpty()
Is the object empty? |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Translate()
| Method Detail |
|---|
public boolean isEmpty()
throws TemplateModelException
TemplateModel
isEmpty in interface TemplateModeltrue if this object is empty, otherwise false
TemplateModelException
public TemplateModel exec(java.util.List<java.lang.String> arguments)
throws TemplateModelException
TemplateMethodModelList of
String objects.
exec in interface TemplateMethodModelarguments - 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 | ||||||||