Class ParameterInterpreter


  • public class ParameterInterpreter
    extends java.lang.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 Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Object interpret​(PluginMethod method, java.util.Map<java.lang.String,​java.lang.Object> args)
      Call interpreter to run a publishing server method using a list of arguments.
      static java.lang.Object interpret​(PluginMethod method, java.util.Map<java.lang.String,​java.lang.Object> args, java.util.List<java.lang.Object> outParameters)
      Call interpreter to run a publishing server method using a list of arguments.
      static java.lang.Object interpret​(java.lang.String command, java.util.Map<java.lang.String,​java.lang.Object> args)
      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)
      static java.lang.Object interpret​(java.lang.String command, java.util.Map<java.lang.String,​java.lang.Object> args, PluginMethod.LogSettings logSettings)
      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)
      static java.lang.Object interpret​(java.lang.String command, java.util.Map<java.lang.String,​java.lang.Object> args, PluginMethod.LogSettings logSettings, java.util.List<java.lang.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 java.lang.Object interpret​(java.lang.String command, java.util.Map<java.lang.String,​java.lang.Object> args, java.util.List<java.lang.Object> outParameters)
      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.
      static PluginMethod parse​(java.lang.String command)
      Parses a command string and return a Plugin method object representing this call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • interpret

        public static java.lang.Object interpret​(PluginMethod method,
                                                 java.util.Map<java.lang.String,​java.lang.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 java.lang.Object interpret​(PluginMethod method,
                                                 java.util.Map<java.lang.String,​java.lang.Object> args,
                                                 java.util.List<java.lang.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 java.lang.Object interpret​(java.lang.String command,
                                                 java.util.Map<java.lang.String,​java.lang.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 java.lang.Object interpret​(java.lang.String command,
                                                 java.util.Map<java.lang.String,​java.lang.Object> args,
                                                 java.util.List<java.lang.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 java.lang.Object interpret​(java.lang.String command,
                                                 java.util.Map<java.lang.String,​java.lang.Object> args,
                                                 PluginMethod.LogSettings logSettings,
                                                 java.util.List<java.lang.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​(java.lang.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