Class FlexibleMapAccessor<T>
java.lang.Object
org.apache.ofbiz.base.util.collections.FlexibleMapAccessor<T>
- All Implemented Interfaces:
Serializable
,IsEmpty
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:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if thisFlexibleMapAccessor
contains a nested expression.boolean
Given the name based information in this accessor, get the value from the passed in Map.Given the name based information in this accessor, get the value from the passed in Map.static <T> FlexibleMapAccessor<T>
getInstance
(String original) Returns a FlexibleMapAccessor instance.boolean
int
hashCode()
boolean
isEmpty()
void
Given the name based information in this accessor, put the value in the passed in Map.Given the name based information in this accessor, remove the value from the passed in Map.toString()
-
Method Details
-
getInstance
Returns a FlexibleMapAccessor instance.- Parameters:
original
- The original String expression- Returns:
- A FlexibleMapAccessor instance
-
containsNestedExpression
public boolean containsNestedExpression()Returnstrue
if thisFlexibleMapAccessor
contains a nested expression.- Returns:
true
if thisFlexibleMapAccessor
contains a nested expression
-
getOriginalName
-
getIsAscending
public boolean getIsAscending() -
isEmpty
public boolean isEmpty() -
get
Given the name based information in this accessor, get the value from the passed in Map. Supports LocalizedMaps by getting a String or Locale object from the base Map with the key "locale", or by explicit locale parameter.- Parameters:
base
-- Returns:
- the found value
-
get
Given the name based information in this accessor, get the value from the passed in Map. Supports LocalizedMaps by getting a String or Locale object from the base Map with the key "locale", or by explicit locale parameter. Note that the localization functionality is only used when the lowest level sub-map implements the LocalizedMap interface- Parameters:
base
- Map to get value fromlocale
- Optional locale parameter, if null will see if the base Map contains a "locale" key- Returns:
- the found value
-
put
Given the name based information in this accessor, put the value in the passed in Map. 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:
base
-value
-
-
remove
Given the name based information in this accessor, remove the value from the passed in Map.- Parameters:
base
- the Map to remove from- Returns:
- the object removed
-
toString
-
equals
-
hashCode
public int hashCode()
-