|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.ecyrd.jspwiki.VariableManager
Manages variables. Variables are case-insensitive. A list of all available variables is on a Wiki page called "WikiVariables".
| Constructor Summary | |
VariableManager(java.util.Properties props)
|
|
| Method Summary | |
java.lang.String |
expandVariables(WikiContext context,
java.lang.String source)
This method does in-place expansion of any variables. |
java.lang.String |
getValue(WikiContext context,
java.lang.String varName)
Returns a value of the named variable. |
static boolean |
isVariableLink(java.lang.String link)
Returns true if the link is really command to insert a variable. |
java.lang.String |
parseAndGetValue(WikiContext context,
java.lang.String link)
Parses the link and finds a value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public VariableManager(java.util.Properties props)
| Method Detail |
public static boolean isVariableLink(java.lang.String link)
Currently we just check if the link starts with "{$".
public java.lang.String parseAndGetValue(WikiContext context,
java.lang.String link)
throws java.lang.IllegalArgumentException,
NoSuchVariableException
A variable is inserted using the notation [{$variablename}].
java.lang.IllegalArgumentException - If the format is not valid (does not
start with {$, is zero length, etc.)
NoSuchVariableException - If a variable is not known.
public java.lang.String expandVariables(WikiContext context,
java.lang.String source)
The variables should be in the same format ({$variablename} as in the web pages.
context - The WikiContext of the current page.source - The source string.
public java.lang.String getValue(WikiContext context,
java.lang.String varName)
throws java.lang.IllegalArgumentException,
NoSuchVariableException
varName - Name of the variable.
java.lang.IllegalArgumentException - If the name is somehow broken.
NoSuchVariableException - If a variable is not known.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||