public class DataContext extends Object implements Map<String,Object>
DataContext
represents a pluggable mechanism for resolving a operation arguments at evaluation time.
DataContext use HashMap and expression (Operation argument expression) is used has key.
get(Object)
Resolve the specified argument expression, and return the corresponding object, if any; otherwise, return null.
For example operation argument contains expression like user.profile.id or ${user.profile.id} and data context provide will used to retrieve the value user.profile.idConstructor and Description |
---|
DataContext() |
DataContext(Map<String,Object> base) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
void |
deRegister()
Remove all registered Converters, and re-establish the standard Converters.
|
void |
deRegister(Class clazz)
Remove any registered Converter for the specified destination Class.
|
Set<Map.Entry<String,Object>> |
entrySet() |
Object |
get(Object key) |
<T> T |
get(String name,
Class<T> type)
Get a named property and convert it into the given type.
|
<T> T |
get(String name,
Class<T> type,
T defaultValue)
Get a named property and convert it into the given type.
|
<T> T |
get(String name,
T defaultValue)
Get a named property and convert it into the given type.
|
boolean |
isEmpty() |
Set<String> |
keySet() |
Object |
put(String key,
Object value) |
void |
putAll(Map<? extends String,?> map) |
void |
register(boolean throwException,
boolean defaultNull,
int defaultArraySize)
Register the provided converters with the specified defaults.
|
void |
register(org.apache.commons.beanutils.Converter converter,
Class<?> clazz)
Register a custom Converter for the specified destination Class, replacing any previously registered Converter.
|
Object |
remove(Object key) |
int |
size() |
Collection<Object> |
values() |
public void deRegister()
public void deRegister(Class clazz)
clazz
- - Class for which to remove a registered Converterpublic void register(boolean throwException, boolean defaultNull, int defaultArraySize)
throwException
- - true if the converters should throw an exception when a conversion error occurs, otherwise false if a default value should be used.defaultNull
- - true if the standard converters (see ConvertUtilsBean.registerStandard(boolean, boolean)
should use a default value of null, otherwise false. N.B. This values is ignored if throwException is truedefaultArraySize
- - The size of the default array value for array converters (N.B. This values is ignored if throwException is true). Specifying a value less than zero causes a null value to be used for the default.public void register(org.apache.commons.beanutils.Converter converter, Class<?> clazz)
converter
- - Converter to be registeredclazz
- - Destination class for conversions performed by this Converterpublic <T> T get(String name, Class<T> type, T defaultValue)
name
- The name of the propertytype
- The class of the typedefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing property is
not converted.null
if
non existing or can't be converted.public <T> T get(String name, Class<T> type)
name
- The name of the propertytype
- The class of the typenull
if
non existing or can't be converted.public <T> T get(String name, T defaultValue)
name
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing property is
not converted.public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
public boolean containsValue(Object value)
public void clear()
public Collection<Object> values()
Copyright © 1982–2022 Adobe Systems Inc.. All rights reserved.