Class MethodContext

java.lang.Object
org.apache.ofbiz.minilang.method.MethodContext

public final class MethodContext extends Object
A container for the Mini-language script engine state.
  • Field Details

  • Constructor Details

  • Method Details

    • getDelegator

      public Delegator getDelegator()
    • getDispatcher

      public LocalDispatcher getDispatcher()
    • getEnv

      public <T> T getEnv(FlexibleMapAccessor<T> fma)
    • getEnv

      public <T> T getEnv(String key)
      Gets the named value from the environment. Supports the "." (dot) syntax to access Map members and the "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other environment values using the "${}" notation.
      Parameters:
      key - The name of the environment value to get. Can contain "." and "[]" syntax elements as described above.
      Returns:
      The environment value if found, otherwise null.
    • getEnvMap

      public Map<String,Object> getEnvMap()
    • getLoader

      public ClassLoader getLoader()
    • getLocale

      public Locale getLocale()
    • getMethodType

      public int getMethodType()
    • getParameter

      public Object getParameter(String key)
    • getParameters

      public Map<String,Object> getParameters()
    • getRequest

      public HttpServletRequest getRequest()
    • getResponse

      public HttpServletResponse getResponse()
    • getResult

      public Object getResult(String key)
    • getResults

      public Map<String,Object> getResults()
    • getSecurity

      public Security getSecurity()
    • getTimeZone

      public TimeZone getTimeZone()
    • getTraceLogLevel

      public int getTraceLogLevel()
    • getUserLogin

      public GenericValue getUserLogin()
    • isTraceOn

      public boolean isTraceOn()
    • putAllEnv

      public void putAllEnv(Map<String,? extends Object> values)
      Calls putEnv for each entry in the Map, thus allowing for the additional flexibility in naming supported in that method.
    • putEnv

      public <T> void putEnv(FlexibleMapAccessor<T> fma, T value)
    • putEnv

      public <T> void putEnv(String key, T value)
      Puts the named value in the environment. Supports the "." (dot) syntax to access Map members and the "[]" (bracket) syntax to access List entries. If the brackets for a list are empty the value will be appended to end of the list, otherwise the value will be set in the position of the number in the brackets. If a "+" (plus sign) is included inside the square brackets before the index number the value will inserted/added at that index instead of set at that index. This value is expanded, supporting the insertion of other environment values using the "${}" notation.
      Parameters:
      key - The name of the environment value to get. Can contain "." syntax elements as described above.
      value - The value to set in the named environment location.
    • putParameter

      public void putParameter(String key, Object value)
    • putResult

      public void putResult(String key, Object value)
    • removeEnv

      public <T> T removeEnv(FlexibleMapAccessor<T> fma)
    • removeEnv

      public <T> T removeEnv(String key)
      Removes the named value from the environment. Supports the "." (dot) syntax to access Map members and the "[]" (bracket) syntax to access List entries. This value is expanded, supporting the insertion of other environment values using the "${}" notation.
      Parameters:
      key - The name of the environment value to get. Can contain "." syntax elements as described above.
    • setTraceOff

      public void setTraceOff()
    • setTraceOn

      public void setTraceOn(int logLevel)
    • setUserLogin

      public void setUserLogin(GenericValue userLogin, String userLoginEnvName)