|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectfreemarker.ext.misc.Match
public final class Match
A method model that implements the Perl 5 match function. This uses the Jakarta ORO library to perform the match.
Usage:
From java:
TemplateModelRoot root = new SimpleHash(); root.put( "match", new freemarker.ext.misc.Match() ); ...
From your FM-Classic template:
The following matches the first two HTML tags:
<assign text = "<p>This paragraph has <em>tags</em> that will be matched.</p>">
<assign output = match( "/<([^>]*)>.*<([^>]*)>/", text )>
Match is: ${output}, first tag is: ${output[1]}, second tag is ${output[2]}.
...
| Constructor Summary | |
|---|---|
Match()
Construct a new match 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 Match()
| Method Detail |
|---|
public boolean isEmpty()
throws TemplateModelException
isEmpty in interface TemplateModelfalse 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 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 | ||||||||