Package nl.rrd.wool.model.command
Class WoolAttributesCommand
- java.lang.Object
-
- nl.rrd.wool.model.command.WoolCommand
-
- nl.rrd.wool.model.command.WoolAttributesCommand
-
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
WoolActionCommand,WoolInputCommand
public abstract class WoolAttributesCommand extends WoolCommand
-
-
Constructor Summary
Constructors Constructor Description WoolAttributesCommand()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description protected static Map<String,WoolBodyToken>parseAttributesCommand(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens)Parses a command that is formatted like:
<<command attr1="value1" attr2="value2">>protected static WoolVariableStringreadAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require)protected static IntegerreadIntAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require, Integer min, Integer max)protected static StringreadPlainTextAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require)protected static StringreadVariableAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require)-
Methods inherited from class nl.rrd.wool.model.command.WoolCommand
clone, executeBodyCommand, findReplyById, getNodePointers, getReadVariableNames, getWriteVariableNames
-
-
-
-
Method Detail
-
parseAttributesCommand
protected static Map<String,WoolBodyToken> parseAttributesCommand(WoolBodyToken cmdStartToken, CurrentIterator<WoolBodyToken> tokens) throws LineNumberParseException
Parses a command that is formatted like:
<<command attr1="value1" attr2="value2">>It returns a map where the keys are attribute names and the values are tokens with type QUOTED_STRING.
- Parameters:
cmdStartToken- the command start tokentokens- the token iterator, positioned after the command start token- Returns:
- the attributes
- Throws:
LineNumberParseException- if a parsing error occurs
-
readAttr
protected static WoolVariableString readAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require) throws LineNumberParseException
- Throws:
LineNumberParseException
-
readPlainTextAttr
protected static String readPlainTextAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require) throws LineNumberParseException
- Throws:
LineNumberParseException
-
readVariableAttr
protected static String readVariableAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require) throws LineNumberParseException
- Throws:
LineNumberParseException
-
readIntAttr
protected static Integer readIntAttr(String name, Map<String,WoolBodyToken> attrs, WoolBodyToken cmdStartToken, boolean require, Integer min, Integer max) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-