Package nl.rrd.wool.model.command
Class WoolCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- Direct Known Subclasses:
WoolAttributesCommand,WoolExpressionCommand
public abstract class WoolCommand extends Object
Base class for commands that are specified with <<...>> in Wool statements and replies.
-
-
Constructor Summary
Constructors Constructor Description WoolCommand()
-
Method Summary
Modifier and Type Method Description abstract voidexecuteBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody)This method is called if this command occurs in a statement body.abstract WoolReplyfindReplyById(int replyId)Tries to find a reply with the specified ID within this command.abstract voidgetNodePointers(Set<WoolNodePointer> pointers)Retrieves all node pointers that occur in this command and adds them to the specified list.abstract voidgetReadVariableNames(Set<String> varNames)Retrieves all variable names that are read in this command and adds them to the specified set.abstract voidgetWriteVariableNames(Set<String> varNames)Retrieves all variable names that are written in this command and adds them to the specified set.
-
-
-
Method Detail
-
findReplyById
public abstract WoolReply findReplyById(int replyId)
Tries to find a reply with the specified ID within this command. If no such reply is found, this method returns null.- Parameters:
replyId- the reply ID- Returns:
- the reply or null
-
getReadVariableNames
public abstract void getReadVariableNames(Set<String> varNames)
Retrieves all variable names that are read in this command and adds them to the specified set.- Parameters:
varNames- the set to which the variable names are added
-
getWriteVariableNames
public abstract void getWriteVariableNames(Set<String> varNames)
Retrieves all variable names that are written in this command and adds them to the specified set.- Parameters:
varNames- the set to which the variable names are added
-
getNodePointers
public abstract void getNodePointers(Set<WoolNodePointer> pointers)
Retrieves all node pointers that occur in this command and adds them to the specified list.- Parameters:
pointers- the list to which the node pointers are added
-
executeBodyCommand
public abstract void executeBodyCommand(Map<String,Object> variables, WoolNodeBody processedBody) throws EvaluationException
This method is called if this command occurs in a statement body. It executes the command with respect to the specified variable map. Any body content that should be sent to the client, is added to "processedBody". This content can be text or client commands, with all variables resolved.- Parameters:
variables- the variable mapprocessedBody- the processed body- Throws:
EvaluationException- if an expression cannot be evaluated
-
-