Class ParameterInterpreter
java.lang.Object
com.priint.pubserver.parameterparser.ParameterInterpreter
Interpreter for calling declared publishing server methods by name.
- All public methods are static.
- The interpreter is thread safe.
- The interpreter utilizes the static
ParameterParserfor analyzing the command or parameter string. - During processing many informations of the interpreter can be logged. Default log level for all components is
PluginMethod.LogLevel.SHORT.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Objectinterpret(PluginMethod method, Map<String, Object> args) Call interpreter to run a publishing server method using a list of arguments.static ObjectCall interpreter to run a publishing server method using a list of arguments.static ObjectCall interpreter to run a command using a list of arguments with default log settings.
If you want to use the parsing capabilities to post process the parameters, seeinterpret(String, Map, List)static ObjectCall interpreter to run a command using a list of arguments.
If you want to use the parsing capabilities to post process the parameters, seeinterpret(String, Map, com.priint.pubserver.plugin.PluginMethod.LogSettings, List)static Objectinterpret(String command, Map<String, Object> args, PluginMethod.LogSettings logSettings, List<Object> outParameters) Call interpreter to run a command using a list of arguments.
If outParameters is non-null, this list will be filled with the parameters parsed during processing the command in exactly the order they appear in the argument string.static ObjectCall interpreter to run a command using a list of arguments with default log settings.
If outParameters is non-null, this list will be filled with the parameters parsed during processing the command in exactly the order they appear in the argument string.static PluginMethodParses a command string and return a Plugin method object representing this call.
-
Method Details
-
interpret
public static Object interpret(PluginMethod method, Map<String, Object> args) throws ParameterInterpreterExceptionCall interpreter to run a publishing server method using a list of arguments. Log settings will be taken from method.
If you want to use the parsing capabilities to post process the parameters, seeinterpret(PluginMethod, Map, List).- Parameters:
method- Reference to a method declared with @PubServerMethodargs- map of names arguments to be used in the call- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
interpret
public static Object interpret(PluginMethod method, Map<String, Object> args, List<Object> outParameters) throws ParameterInterpreterExceptionCall interpreter to run a publishing server method using a list of arguments. Log settings will be taken from method.
If outParameters is non-null, this list will be filled with the parameters parsed during processing the command in exactly the order they appear in the argument string.- Parameters:
method- Reference to a method declared with @PubServerMethodargs- map of names arguments to be used in the calloutParameters- (empty) list, which will be filled with parameters parsed during processing- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
interpret
public static Object interpret(String command, Map<String, Object> args) throws ParameterInterpreterExceptionCall interpreter to run a command using a list of arguments with default log settings.
If you want to use the parsing capabilities to post process the parameters, seeinterpret(String, Map, List)- Parameters:
command- A string containing a valid parameter interpreter command.args- map of names arguments to be used in the call- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
interpret
public static Object interpret(String command, Map<String, Object> args, List<Object> outParameters) throws ParameterInterpreterExceptionCall interpreter to run a command using a list of arguments with default log settings.
If outParameters is non-null, this list will be filled with the parameters parsed during processing the command in exactly the order they appear in the argument string.- Parameters:
command- A string containing a valid parameter interpreter command.args- map of names arguments to be used in the calloutParameters- (empty) list, which will be filled with parameters parsed during processing- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
interpret
public static Object interpret(String command, Map<String, Object> args, PluginMethod.LogSettings logSettings) throws ParameterInterpreterExceptionCall interpreter to run a command using a list of arguments.
If you want to use the parsing capabilities to post process the parameters, seeinterpret(String, Map, com.priint.pubserver.plugin.PluginMethod.LogSettings, List)- Parameters:
command- A string containing a valid parameter interpreter command.args- map of names arguments to be used in the calllogSettings- set how detailed the logger output will be- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
interpret
public static Object interpret(String command, Map<String, Object> args, PluginMethod.LogSettings logSettings, List<Object> outParameters) throws ParameterInterpreterExceptionCall interpreter to run a command using a list of arguments.
If outParameters is non-null, this list will be filled with the parameters parsed during processing the command in exactly the order they appear in the argument string.- Parameters:
command- A string containing a valid parameter interpreter command.args- map of names arguments to be used in the calllogSettings- set how detailed the logger output will beoutParameters- (empty) list, which will be filled with parameters parsed during processing- Returns:
- return object of the interpreter call, e.g. a List
- Throws:
ParameterInterpreterException- is thrown if the method call fails for any reason
-
parse
Parses a command string and return a Plugin method object representing this call.
This method is particularly useful, if you need information about the number and types of parameters passed to the method call or the name of the Plugin, class and method to be called.
The PluginMethod object returned may be modified and sent again to the ParameterInterpreter using theinterpret(PluginMethod, Map, List)method.- Parameters:
command- the command to be parsed- Returns:
- a PluginMethod object representing this call
- Throws:
ParameterInterpreterException
-