|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.slamd.scripting.engine.Variable
This class defines a generic variable that may be defined in an LDAP script.
| Constructor Summary | |
Variable()
Creates a new variable with no name, to be used only when creating a variable with Class.newInstance(), and only when
setName() is called after that to set the name. |
|
Variable(java.lang.String name)
Creates a generic variable with a name but no value. |
|
| Method Summary | |
abstract void |
assign(Argument argument)
Assigns the value of the provided argument to this variable. |
abstract Variable |
executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
Executes the specified method, using the provided variables as arguments to the method, and makes the return value available to the caller. |
java.lang.String |
getArgumentAsString()
Retrieves a string representation of this argument in a form appropriate for inclusion in a script. |
java.lang.String |
getArgumentType()
Retrieves the name of the data type associated with this argument. |
Variable |
getArgumentValue()
Retrieves the value of this argument. |
abstract int |
getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the method number for the method that has the specified name and argument types, or -1 if there is no such method. |
abstract Method[] |
getMethods()
Retrieves a list of all methods defined for this variable. |
java.lang.String |
getName()
Retrieves the name of this variable. |
abstract java.lang.String |
getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
Retrieves the return type for the method with the specified name and argument types. |
StatTracker[] |
getStatTrackers()
Retrieves the set of stat trackers that are maintained for this variable type. |
abstract java.lang.String |
getVariableTypeName()
Retrieves the name of the variable type for this variable. |
abstract boolean |
hasMethod(java.lang.String methodName)
Indicates whether this variable type has a method with the specified name. |
static boolean |
isValidIdentifier(java.lang.String identifierName)
Indicates whether the specified string may be used as a variable or method identifier in a SLAMD script. |
void |
setName(java.lang.String name)
Sets the name of this variable. |
void |
startStatTrackers(JobClass jobThread)
Notifies all the stat trackers associated with this variable type that they should start collecting statistics. |
void |
stopStatTrackers()
Notifies all the stat trackers associated with this variable type that they should start collecting statistics. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.sun.slamd.scripting.engine.Argument |
getValueAsString |
| Constructor Detail |
public Variable()
Class.newInstance(), and only when
setName() is called after that to set the name.
public Variable(java.lang.String name)
name - The name to use for this variable.| Method Detail |
public abstract java.lang.String getVariableTypeName()
public void setName(java.lang.String name)
name - The name to use for this variable.public java.lang.String getName()
public static boolean isValidIdentifier(java.lang.String identifierName)
identifierName - The name of the identifier for which to make the
determination.
true if the provided name may be used as a valid
identifier, or false if not.public abstract Method[] getMethods()
public abstract boolean hasMethod(java.lang.String methodName)
methodName - The name of the method.
true if this variable has a method with the specified
name, or false if it does not.
public abstract int getMethodNumber(java.lang.String methodName,
java.lang.String[] argumentTypes)
methodName - The name of the method.argumentTypes - The list of argument types for the method.
public abstract java.lang.String getReturnTypeForMethod(java.lang.String methodName,
java.lang.String[] argumentTypes)
methodName - The name of the method.argumentTypes - The set of argument types for the method.
null if there is
no such method defined.
public abstract Variable executeMethod(int lineNumber,
int methodNumber,
Argument[] arguments)
throws ScriptException
lineNumber - The line number of the script in which the method
call occurs.methodNumber - The method number of the method to execute.arguments - The set of arguments to use for the method.
null if it
does not return a value.
ScriptException - If the specified method does not exist, or if a
problem occurs while attempting to execute it.public StatTracker[] getStatTrackers()
startStatTrackers()
and stopStatTrackers() methods must also be implemented to
make sure that they are handled properly.
public void startStatTrackers(JobClass jobThread)
jobThread - The job thread for which the statistics will be
gathered.public void stopStatTrackers()
public java.lang.String getArgumentType()
getArgumentType in interface Argument
public Variable getArgumentValue()
throws ScriptException
getArgumentValue in interface ArgumentScriptException - If a problem occurs while determing the value of
this argument.
public abstract void assign(Argument argument)
throws ScriptException
argument - The argument whose value should be assigned to this
variable.
ScriptException - If there is a problem while performing the
assignment.public java.lang.String getArgumentAsString()
getArgumentAsString in interface Argument
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||