|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Registry for string variables.
Field Summary | |
static String |
EXTENSION_POINT_DYNAMIC_VARIABLES
Simple identifier constant (value "dynamicVariables" ) for the
dynamic variables extension point. |
static String |
EXTENSION_POINT_VALUE_VARIABLES
Simple identifier constant (value "valueVariables" ) for the
value variables extension point. |
Method Summary | |
void |
addValueVariableListener(IValueVariableListener listener)
Registers the given listener for value variable notifications. |
void |
addVariables(IValueVariable[] variables)
Adds the given variables to the variable registry. |
String |
generateVariableExpression(String varName,
String arg)
Convenience method that returns an expression referencing the given variable and optional argument. |
IDynamicVariable |
getDynamicVariable(String name)
Returns the dynamic variable with the given name or null
if none. |
IDynamicVariable[] |
getDynamicVariables()
Returns all registered dynamic variables. |
IValueVariable |
getValueVariable(String name)
Returns the value variable with the given name, or null
if none. |
IValueVariable[] |
getValueVariables()
Returns all registered value variables. |
IStringVariable[] |
getVariables()
Returns all registered variables. |
IValueVariable |
newValueVariable(String name,
String description)
Returns a new value variable with the given name and description. |
String |
performStringSubstitution(String expression)
Recursively resolves and replaces all variable references in the given expression with their corresponding values. |
String |
performStringSubstitution(String expression,
boolean reportUndefinedVariables)
Recursively resolves and replaces all variable references in the given expression with their corresponding values. |
void |
removeValueVariableListener(IValueVariableListener listener)
Removes the given listener from the list of registered value variable listeners. |
void |
removeVariables(IValueVariable[] variables)
Removes the given variables from the registry. |
void |
validateStringVariables(String expression)
Validates variables references in the given expression and reports errors for references to undefined variables. |
Field Detail |
public static final String EXTENSION_POINT_DYNAMIC_VARIABLES
"dynamicVariables"
) for the
dynamic variables extension point.
public static final String EXTENSION_POINT_VALUE_VARIABLES
"valueVariables"
) for the
value variables extension point.
Method Detail |
public IStringVariable[] getVariables()
public IValueVariable[] getValueVariables()
public IValueVariable getValueVariable(String name)
null
if none.
name
- variable name
null
if nonepublic IDynamicVariable[] getDynamicVariables()
public IDynamicVariable getDynamicVariable(String name)
null
if none.
name
- variable name
null
if nonepublic String performStringSubstitution(String expression) throws CoreException
performStringSubstitution(expression, true)
).
expression
- expression referencing variables
CoreException
- if unable to resolve the value of one or more variablespublic String performStringSubstitution(String expression, boolean reportUndefinedVariables) throws CoreException
expression
- expression referencing variablesreportUndefinedVariables
- whether a reference to an undefined variable
is to be considered an error (i.e. throw an exception)
CoreException
- if unable to resolve the value of one or more variablespublic void validateStringVariables(String expression) throws CoreException
expression
- expression referencing variables
CoreException
- if one or more referenced variables do not existpublic IValueVariable newValueVariable(String name, String description)
name
- variable name, cannot be null
description
- variable description, possibly null
CoreException
- if a variable already exists with the given namepublic void addVariables(IValueVariable[] variables) throws CoreException
variables
- the variables to add
CoreException
- if one or more variables to add has a name collision with
an existing variablepublic void removeVariables(IValueVariable[] variables)
variables
- variables to removepublic void addValueVariableListener(IValueVariableListener listener)
listener
- value variable listener to addpublic void removeValueVariableListener(IValueVariableListener listener)
listener
- value variable listener to removepublic String generateVariableExpression(String varName, String arg)
varName
of my_var
and an argument
of my_arg
results in the string $(my_var:my_arg}
.
varName
- variable namearg
- argument text or null
|
Eclipse Platform Release 3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.