Class ParameterInterpreter

java.lang.Object
com.priint.pubserver.parameterparser.ParameterInterpreter

public class ParameterInterpreter extends Object
Interpreter for calling declared publishing server methods by name.

  • All public methods are static.
  • The interpreter is thread safe.
  • The interpreter utilizes the static ParameterParser for 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 Details

    • interpret

      public static Object interpret(PluginMethod method, Map<String,Object> args) throws ParameterInterpreterException
      Call 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, see interpret(PluginMethod, Map, List).
      Parameters:
      method - Reference to a method declared with @PubServerMethod
      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(PluginMethod method, Map<String,Object> args, List<Object> outParameters) throws ParameterInterpreterException
      Call 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 @PubServerMethod
      args - map of names arguments to be used in the call
      outParameters - (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 ParameterInterpreterException
      Call 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, see interpret(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 ParameterInterpreterException
      Call 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 call
      outParameters - (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 ParameterInterpreterException
      Call interpreter to run a command using a list of arguments.
      If you want to use the parsing capabilities to post process the parameters, see interpret(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 call
      logSettings - 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 ParameterInterpreterException
      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.
      Parameters:
      command - A string containing a valid parameter interpreter command.
      args - map of names arguments to be used in the call
      logSettings - set how detailed the logger output will be
      outParameters - (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

      public static PluginMethod parse(String command) throws ParameterInterpreterException

      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 the interpret(PluginMethod, Map, List) method.

      Parameters:
      command - the command to be parsed
      Returns:
      a PluginMethod object representing this call
      Throws:
      ParameterInterpreterException