Package org.apache.ofbiz.minilang.method
Class MethodContext
java.lang.Object
org.apache.ofbiz.minilang.method.MethodContext
A container for the Mini-language script engine state.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMethodContext
(Map<String, ? extends Object> context, ClassLoader loader, int methodType) This is a very simple constructor which assumes the needed objects (dispatcher, delegator, security, request, response, etc) are in the context.MethodContext
(HttpServletRequest request, HttpServletResponse response, ClassLoader loader) MethodContext
(DispatchContext ctx, Map<String, ? extends Object> context, ClassLoader loader) -
Method Summary
Modifier and TypeMethodDescription<T> T
Gets the named value from the environment.<T> T
getEnv
(FlexibleMapAccessor<T> fma) int
getParameter
(String key) int
boolean
void
Calls putEnv for each entry in the Map, thus allowing for the additional flexibility in naming supported in that method.<T> void
Puts the named value in the environment.<T> void
putEnv
(FlexibleMapAccessor<T> fma, T value) void
putParameter
(String key, Object value) void
<T> T
Removes the named value from the environment.<T> T
removeEnv
(FlexibleMapAccessor<T> fma) void
void
setTraceOn
(int logLevel) void
setUserLogin
(GenericValue userLogin, String userLoginEnvName)
-
Field Details
-
EVENT
public static final int EVENT- See Also:
-
SERVICE
public static final int SERVICE- See Also:
-
-
Constructor Details
-
MethodContext
-
MethodContext
-
MethodContext
This is a very simple constructor which assumes the needed objects (dispatcher, delegator, security, request, response, etc) are in the context. Will result in calling method as a service or event, as specified.
-
-
Method Details
-
getDelegator
-
getDispatcher
-
getEnv
-
getEnv
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
-
getLoader
-
getLocale
-
getMethodType
public int getMethodType() -
getParameter
-
getParameters
-
getRequest
-
getResponse
-
getResult
-
getResults
-
getSecurity
-
getTimeZone
-
getTraceLogLevel
public int getTraceLogLevel() -
getUserLogin
-
isTraceOn
public boolean isTraceOn() -
putAllEnv
Calls putEnv for each entry in the Map, thus allowing for the additional flexibility in naming supported in that method. -
putEnv
-
putEnv
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
-
putResult
-
removeEnv
-
removeEnv
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
-