|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.misc.Substitute
public final class Substitute
A method model that implements the Perl 5 substitute function. This uses the Jakarta ORO library to perform the substitute.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "substitute", new freemarker.ext.misc.Substitute() ); ...
From your FM-Classic template:
The following is stripped of HTML tags: <assign text = "<p>This paragraph has <em>all</em> tags removed.</p>"> <assign output = substitute( "s/<[^>]*>//g", text )> ${output} ...
Constructor Summary | |
---|---|
Substitute()
Construct a new substitution method. |
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 Substitute()
Method Detail |
---|
public boolean isEmpty() throws TemplateModelException
isEmpty
in interface TemplateModel
false
to indicate the method is not empty
TemplateModelException
public TemplateModel exec(java.util.List<java.lang.String> arguments) throws TemplateModelException
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 |