|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecyrd.jspwiki.VariableManager
public class VariableManager
Manages variables. Variables are case-insensitive. A list of all available variables is on a Wiki page called "WikiVariables".
Field Summary | |
---|---|
protected static String[] |
THE_BIG_NO_NO_LIST
Contains a list of those properties that shall never be shown. |
static String |
VAR_ERROR
|
static String |
VAR_MSG
|
Constructor Summary | |
---|---|
VariableManager(Properties props)
|
Method Summary | |
---|---|
String |
expandVariables(WikiContext context,
String source)
This method does in-place expansion of any variables. |
String |
getValue(WikiContext context,
String varName)
Returns a value of the named variable. |
String |
getValue(WikiContext context,
String varName,
String defValue)
|
static boolean |
isVariableLink(String link)
Returns true if the link is really command to insert a variable. |
String |
parseAndGetValue(WikiContext context,
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 |
Field Detail |
---|
public static final String VAR_ERROR
public static final String VAR_MSG
protected static final String[] THE_BIG_NO_NO_LIST
Constructor Detail |
---|
public VariableManager(Properties props)
Method Detail |
---|
public static boolean isVariableLink(String link)
Currently we just check if the link starts with "{$".
public String parseAndGetValue(WikiContext context, String link) throws IllegalArgumentException, NoSuchVariableException
A variable is inserted using the notation [{$variablename}].
IllegalArgumentException
- If the format is not valid (does not
start with {$, is zero length, etc.)
NoSuchVariableException
- If a variable is not known.public String expandVariables(WikiContext context, 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 String getValue(WikiContext context, String varName, String defValue)
public String getValue(WikiContext context, String varName) throws IllegalArgumentException, NoSuchVariableException
varName
- Name of the variable.
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 |