Class FlexibleServletAccessor<T>
java.lang.Object
org.apache.ofbiz.base.util.collections.FlexibleServletAccessor<T>
- All Implemented Interfaces:
Serializable
Used to flexibly access Map values, supporting the "." (dot) syntax for
accessing sub-map values and the "[]" (square bracket) syntax for accessing
list elements. See individual Map operations for more information.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
The equals and hashCode methods are implemented just in case this object is ever accidently used as a Map keyget
(HttpSession session, Map<String, Object> expandContext) Based on name get from HttpSession or from List in HttpSessionget
(ServletRequest request, Map<String, Object> expandContext) Based on name get from ServletRequest or from List in ServletRequestint
hashCode()
The equals and hashCode methods are implemented just case this object is ever accidently used as a Map key *protected void
Init.boolean
isEmpty()
Is empty boolean.void
Based on name put in HttpSession or from List in HttpSession; If the brackets for a list are empty the value will be appended to the list, otherwise the value will be set in the position of the number in the brackets.void
Based on name put in ServletRequest or from List in ServletRequest; If the brackets for a list are empty the value will be appended to the list, otherwise the value will be set in the position of the number in the brackets.remove
(HttpSession session, Map<String, Object> expandContext) Based on name remove from HttpSession or from List in HttpSessionremove
(ServletRequest request, Map<String, Object> expandContext) Based on name remove from ServletRequest or from List in ServletRequesttoString()
To be used for a string representation of the accessor, returns the original name.
-
Constructor Details
-
FlexibleServletAccessor
-
FlexibleServletAccessor
-
-
Method Details
-
init
Init.- Parameters:
name
- the name
-
isEmpty
public boolean isEmpty()Is empty boolean.- Returns:
- the boolean
-
get
Based on name get from ServletRequest or from List in ServletRequest- Parameters:
request
- request to get the value fromexpandContext
- the context to use for name expansion- Returns:
- the object corresponding to this getter class
-
get
Based on name get from HttpSession or from List in HttpSession- Parameters:
session
-expandContext
-- Returns:
- the found value
-
put
Based on name put in ServletRequest or from List in ServletRequest; If the brackets for a list are empty the value will be appended to 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 point instead of set at the point.- Parameters:
request
-value
-expandContext
-
-
put
Based on name put in HttpSession or from List in HttpSession; If the brackets for a list are empty the value will be appended to 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 point instead of set at the point.- Parameters:
session
-value
-expandContext
-
-
remove
Based on name remove from ServletRequest or from List in ServletRequest- Parameters:
request
-expandContext
-- Returns:
- the removed value
-
remove
Based on name remove from HttpSession or from List in HttpSession- Parameters:
session
-expandContext
-- Returns:
- the removed value
-
hashCode
public int hashCode()The equals and hashCode methods are implemented just case this object is ever accidently used as a Map key * -
equals
The equals and hashCode methods are implemented just in case this object is ever accidently used as a Map key -
toString
To be used for a string representation of the accessor, returns the original name.
-