Package nl.rrd.wool.model.command
Class WoolInputCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolAttributesCommand
-
- nl.rrd.wool.model.command.WoolInputCommand
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
WoolInputNumericCommand,WoolInputSetCommand,WoolInputTextCommand,WoolInputTimeCommand
public abstract class WoolInputCommand extends WoolAttributesCommand
This class models the <<input ...>> command in Wool. It can be part of aWoolNodeBodyinside a reply.
-
-
Constructor Summary
Constructors Constructor Description WoolInputCommand(String type)WoolInputCommand(WoolInputCommand other)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description WoolReplyfindReplyById(int replyId)Tries to find a reply with the specified ID within this command.voidgetNodePointers(Set<WoolNodePointer> pointers)Retrieves all node pointers that occur in this command and adds them to the specified list.abstract Map<String,?>getParameters()Returns the parameters for this input command to send to the client.abstract StringgetStatementLog(WoolVariableStore varStore)Returns the string to use in the user statement log in place of this input command.StringgetType()static WoolInputCommandparse(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens, WoolNodeState nodeState)voidsetType(String type)-
Methods inherited from class nl.rrd.wool.model.command.WoolAttributesCommand
parseAttributesCommand, readAttr, readIntAttr, readPlainTextAttr, readVariableAttr
-
Methods inherited from class nl.rrd.wool.model.command.WoolCommand
clone, executeBodyCommand, getReadVariableNames, getWriteVariableNames
-
-
-
-
Field Detail
-
TYPE_TEXT
public static final String TYPE_TEXT
- See Also:
- Constant Field Values
-
TYPE_NUMERIC
public static final String TYPE_NUMERIC
- See Also:
- Constant Field Values
-
TYPE_SET
public static final String TYPE_SET
- See Also:
- Constant Field Values
-
TYPE_TIME
public static final String TYPE_TIME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
WoolInputCommand
public WoolInputCommand(String type)
-
WoolInputCommand
public WoolInputCommand(WoolInputCommand other)
-
-
Method Detail
-
getType
public String getType()
-
setType
public void setType(String type)
-
getParameters
public abstract Map<String,?> getParameters()
Returns the parameters for this input command to send to the client. This is a map from parameter names to values. A value can be any JSON type. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Returns:
- the parameters for this input command to send to the client
-
getStatementLog
public abstract String getStatementLog(WoolVariableStore varStore)
Returns the string to use in the user statement log in place of this input command. It can use variable values from the specified variable store. This method should only be called on a command that has already been executed withexecuteBodyCommand(). This means that any variables in parameter values have already been resolved.- Parameters:
varStore- the variable store- Returns:
- the statement log
-
findReplyById
public WoolReply findReplyById(int replyId)
Description copied from class:WoolCommandTries to find a reply with the specified ID within this command. If no such reply is found, this method returns null.- Specified by:
findReplyByIdin classWoolCommand- Parameters:
replyId- the reply ID- Returns:
- the reply or null
-
getNodePointers
public void getNodePointers(Set<WoolNodePointer> pointers)
Description copied from class:WoolCommandRetrieves all node pointers that occur in this command and adds them to the specified list.- Specified by:
getNodePointersin classWoolCommand- Parameters:
pointers- the list to which the node pointers are added
-
parse
public static WoolInputCommand parse(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens, WoolNodeState nodeState) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-