@NotThreadSafe public class RequestParamMap extends Object implements IRequestParamMap
struct[key]=value results in a
map{struct=map{key=value}}.struct[key2]=value2 is added the resulting
map looks like this: map{struct=map{key=value, key2=value2}}.
Theses maps can indefinitely be nested.struct[key1][key2][key3]=value results in
map{struct=map{key1=map{key2=map{key3=value}}}}setSeparators(char, char) and
setSeparators(String, String) offer the possibility to set different
separator separators that are not special.| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CLOSE |
static String |
DEFAULT_OPEN |
| Constructor and Description |
|---|
RequestParamMap() |
RequestParamMap(Map<String,?> aMap)
This constructor is private, because it does not call the
put(String, Object) method which does the main string parsing! |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String... aPath) |
boolean |
containsKey(String sKey)
Check if this map, contains the passed key.
|
static IRequestParamMap |
create(Map<String,Object> aAttrCont) |
static IRequestParamMap |
createFromRequest(javax.servlet.http.HttpServletRequest aHttpRequest) |
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,RequestParamMapItem> |
getAsObjectMap() |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getAsValueMap() |
static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getAsValueMap(Map<String,? extends RequestParamMapItem> aMap) |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getAsValueTrimmedMap() |
static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getAsValueTrimmedMap(Map<String,? extends RequestParamMapItem> aMap) |
static String |
getCloseSeparator() |
static String |
getFieldName(String sBaseName)
Deprecated.
|
static String |
getFieldName(String sBaseName,
int... aSuffixes) |
static String |
getFieldName(String sBaseName,
String... aSuffixes) |
IRequestParamMap |
getMap(String... aPath)
Get a nested map for the specified path.
|
RequestParamMapItem |
getObject(String... aPath) |
static String |
getOpenSeparator() |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getValueMap(String... aPath) |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> |
getValueTrimmedMap(String... aPath) |
int |
hashCode() |
boolean |
isEmpty() |
com.helger.commons.collection.impl.ICommonsOrderedSet<String> |
keySet() |
void |
put(String sPath,
Object aValue) |
static void |
setSeparators(char cOpen,
char cClose)
Set the separator chars to use.
|
static void |
setSeparators(String sOpen,
String sClose)
Set the separators to use.
|
static void |
setSeparatorsToDefault() |
int |
size() |
String |
toString() |
com.helger.commons.collection.impl.ICommonsList<RequestParamMapItem> |
values() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBigDecimal, getBigInteger, getBoolean, getDouble, getInt, getLong, getString, getStringTrimmed, isCheckBoxCheckedpublic static final String DEFAULT_OPEN
public static final String DEFAULT_CLOSE
public RequestParamMap()
public RequestParamMap(@Nonnull Map<String,?> aMap)
put(String, Object) method which does the main string parsing!aMap - The map to use. May not be null.public boolean contains(@Nonnull @Nonempty String... aPath)
contains in interface IRequestParamMap@Nullable public RequestParamMapItem getObject(@Nonnull @Nonempty String... aPath)
getObject in interface IRequestParamMap@Nullable public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getValueMap(@Nonnull @Nonempty String... aPath)
getValueMap in interface IRequestParamMap@Nullable public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getValueTrimmedMap(@Nonnull @Nonempty String... aPath)
getValueTrimmedMap in interface IRequestParamMap@Nullable @ReturnsMutableCopy public IRequestParamMap getMap(@Nonnull @Nonempty String... aPath)
IRequestParamMapgetMap in interface IRequestParamMapaPath - The path to be resolvednull if the path could not be resolved.public boolean containsKey(@Nullable String sKey)
IRequestParamMapcontainsKey in interface IRequestParamMapsKey - The key to check.true if such a key is contained, false if
notpublic boolean isEmpty()
isEmpty in interface com.helger.commons.lang.IHasSize@Nonnegative public int size()
size in interface com.helger.commons.lang.IHasSize@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedSet<String> keySet()
keySet in interface IRequestParamMapnull but maybe empty.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<RequestParamMapItem> values()
values in interface IRequestParamMapString, file item (from upload) or Map
from String to Object.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,RequestParamMapItem> getAsObjectMap()
getAsObjectMap in interface IRequestParamMapIRequestParamMap.values()@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAsValueMap(@Nonnull Map<String,? extends RequestParamMapItem> aMap)
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAsValueMap()
getAsValueMap in interface IRequestParamMap@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAsValueTrimmedMap(@Nonnull Map<String,? extends RequestParamMapItem> aMap)
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsOrderedMap<String,String> getAsValueTrimmedMap()
getAsValueTrimmedMap in interface IRequestParamMap@Nonnull public static IRequestParamMap createFromRequest(@Nonnull javax.servlet.http.HttpServletRequest aHttpRequest)
@Nonnull @Nonempty @Deprecated public static String getFieldName(@Nonnull @Nonempty String sBaseName)
sBaseName - Base name@Nonnull @Nonempty public static String getFieldName(@Nonnull @Nonempty String sBaseName, @Nullable String... aSuffixes)
@Nonnull @Nonempty public static String getFieldName(@Nonnull @Nonempty String sBaseName, @Nullable int... aSuffixes)
public static void setSeparatorsToDefault()
public static void setSeparators(char cOpen,
char cClose)
cOpen - Open charcClose - Close char - must be different from open char!public static void setSeparators(@Nonnull @Nonempty String sOpen, @Nonnull @Nonempty String sClose)
sOpen - Open string. May neither be null nor empty.sClose - Close string. May neither be null nor empty.@Nonnull @Nonempty public static String getOpenSeparator()
null nor
empty.DEFAULT_OPEN@Nonnull @Nonempty public static String getCloseSeparator()
null nor
empty.DEFAULT_CLOSECopyright © 2016–2019 Philip Helger. All rights reserved.