|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CommandFactory<C extends Command>
This is a factory class to create Command instances. Some CommandFactories might also be capable to parse Commands from a given String.
Method Summary | |
---|---|
CommandFactory<C> |
getParentFactory()
Get the parent factory for this factory. |
java.util.Set<C> |
getSupportedCommands()
Get a set of all supported commands. |
C |
make(java.lang.String name,
BasicType[] params)
Make a new Command with the given name and params. |
C |
make(java.lang.String name,
java.lang.String[] params)
Make a new Command with the given name and params. |
C |
parse(java.lang.String str)
Make a new Command by parsing it from a string. |
void |
setParentFactory(CommandFactory<C> newParent)
Set the parent factory for this factory. |
Method Detail |
---|
java.util.Set<C> getSupportedCommands()
CommandFactory<C> getParentFactory()
void setParentFactory(CommandFactory<C> newParent)
The
- new parent factory or null to clear.C make(java.lang.String name, java.lang.String[] params) throws UnknownCommandException, CommandStringIncompleteException
name
- The command's name.params
- The command's params - in string representation.
UnknownCommandException
CommandStringIncompleteException
C make(java.lang.String name, BasicType[] params) throws UnknownCommandException, CommandStringIncompleteException
name
- The command's name.params
- The command's params - in BasicType representation.
UnknownCommandException
CommandStringIncompleteException
C parse(java.lang.String str) throws java.lang.UnsupportedOperationException, UnknownCommandException, CommandStringIncompleteException, java.text.ParseException
str
- The string to parse the command from.
java.lang.UnsupportedOperationException
- if the underlying command implementation
does not support parsing.
CommandStringIncompleteException
- If the given String lacks some data at the end.
java.text.ParseException
- If the given String is malformed.
UnknownCommandException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |