| java.lang.Object com.ecyrd.jspwiki.VariableManager
VariableManager | public class VariableManager (Code) | | Manages variables. Variables are case-insensitive. A list of all
available variables is on a Wiki page called "WikiVariables".
author: Janne Jalkanen since: 1.9.20. |
THE_BIG_NO_NO_LIST | final static String[] THE_BIG_NO_NO_LIST(Code) | | Contains a list of those properties that shall never be shown.
Put names here in lower case.
|
VariableManager | public VariableManager(Properties props)(Code) | | Creates a VariableManager object using the property list given.
Parameters: props - The properties. |
expandVariables | public String expandVariables(WikiContext context, String source)(Code) | | This method does in-place expansion of any variables. However,
the expansion is not done twice, that is, a variable containing text $variable
will not be expanded.
The variables should be in the same format ({$variablename} as in the web
pages.
Parameters: context - The WikiContext of the current page. Parameters: source - The source string. The source string with variables expanded. |
getValue | public String getValue(WikiContext context, String varName, String defValue)(Code) | | Returns the value of a named variable. See
VariableManager.getValue(WikiContext,String) .
The only difference is that this method does not throw an exception, but it
returns the given default value instead.
Parameters: context - WikiContext Parameters: varName - The name of the variable Parameters: defValue - A default value. The variable value, or if not found, the default value. |
getValue | public String getValue(WikiContext context, String varName) throws IllegalArgumentException, NoSuchVariableException(Code) | | Returns a value of the named variable. The resolving order is
- Known "constant" name, such as "pagename", etc. This is so
that pages could not override certain constants.
- WikiContext local variable. This allows a programmer to
set a parameter which cannot be overridden by user.
- HTTP Session
- HTTP Request parameters
- WikiPage variable. As set by the user with the SET directive.
- jspwiki.properties
Use this method only whenever you really need to have a parameter that
can be overridden by anyone using the wiki.
Parameters: context - The WikiContext Parameters: varName - Name of the variable. The variable value. throws: IllegalArgumentException - If the name is somehow broken. throws: NoSuchVariableException - If a variable is not known. |
isVariableLink | public static boolean isVariableLink(String link)(Code) | | Returns true if the link is really command to insert
a variable.
Currently we just check if the link starts with "{$".
Parameters: link - The link text true, if this represents a variable link. |
|
|