public class KeyedAccess extends AccessStrategy
AccessStrategy to get a keyed value from a Map. Contains
special handling when a string key is used against a container type whose key
parameter is not assignable from String: against a map whose key type
is an enum class, it will be interpreted as a named enum constant; other key
types will be compared via Object.toString().| Constructor and Description |
|---|
KeyedAccess(Type containerType,
Object key)
Create a new KeyedAccess instance.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object instance)
Get the value from the given instance.
|
ElementType |
getElementType()
Get the Java program
ElementType used by this AccessStrategy
to determine property values. |
static Type |
getJavaElementType(Type containerType)
Get the Java element type of a particular container type.
|
Type |
getJavaType()
Get the type of the property
|
String |
getPropertyName()
Get a name representative of this property.
|
public static Type getJavaElementType(Type containerType)
containerType - null if containerType is not
some kind of Mappublic Object get(Object instance)
get in class AccessStrategypublic ElementType getElementType()
ElementType used by this AccessStrategy
to determine property values.getElementType in class AccessStrategypublic Type getJavaType()
getJavaType in class AccessStrategypublic String getPropertyName()
getPropertyName in class AccessStrategyCopyright © 2010–2024 The Apache Software Foundation. All rights reserved.