public class SimpleProperty extends AbstractProperty
Constructor and Description |
---|
SimpleProperty(String property) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Object |
get(IPropertySource source,
boolean instantiateAll)
Introspects source to retrieve property value.
|
Class<?> |
getGenericCollectionType(IPropertySource source)
Tries to detect if the generic type of the property if the type is a Collection, knowing the argument type to use.
|
Class<?> |
getGenericMapKeyType(IPropertySource source)
Tries to detect if the generic key type of the property if the type is a Map, knowing the argument type to use.
|
Class<?> |
getGenericMapValueType(IPropertySource source)
Tries to detect if the generic value type of the property if the type is a Map, knowing the argument type to use.
|
Class<?>[] |
getGenericTypes(IPropertySource source)
Tries to detect if the parameterized types of the property, whatever its type is, knowing the argument type to use.
|
String |
getProperty() |
protected IMethodInvoker |
getReadMethod(IPropertySource source,
boolean mandatory) |
Class<?> |
getType(IPropertySource source)
Tries to detect if the type of the property, knowing the argument type to use.
|
protected IMethodInvoker |
getWriteMethod(IPropertySource source,
boolean mandatory) |
protected Class<?> |
getWriteMethodParamType(IPropertySource source,
boolean mandatory) |
protected Object |
handleGetFromMap(IPropertySource source,
boolean instantiateAll,
Map<?,?> map)
Gets an object from a typed map.
|
protected Object |
handleSetInTypedMap(TypedMap curTarget,
Object obj,
boolean forceUseProvidedObjectType)
Set an object to a typed map.
|
int |
hashCode() |
boolean |
isReadable(IPropertySource source)
Tries to detect if the property will be able to be read in theory, knowing the argument type to use.
|
boolean |
isWriteable(IPropertySource target)
Tries to detect if the property will be able to be written in theory, knowing the argument type to use.
|
Object |
set(IPropertySource target,
Object obj,
boolean instanciateNested)
Introspects target to set property value.
|
String |
toString() |
get, getGenericCollectionType, getGenericMapKeyType, getGenericMapValueType, getGenericTypes, getType, isReadable, isWriteable, set
public SimpleProperty(String property)
public Object get(IPropertySource source, boolean instantiateAll) throws UtilsException
IProperty
source
- Source context to introspect.instantiateAll
- whether to try or not to instantiate null nested properties values.UtilsException
public Object set(IPropertySource target, Object obj, boolean instanciateNested) throws UtilsException
IProperty
target
- Source context to introspect.obj
- Value to setinstanciateNested
- whether to try or not to instantiate null nested properties values.UtilsException
protected Object handleGetFromMap(IPropertySource source, boolean instantiateAll, Map<?,?> map) throws UtilsException
UtilsException
protected Object handleSetInTypedMap(TypedMap curTarget, Object obj, boolean forceUseProvidedObjectType) throws UtilsException
curTarget
- Map where the value will be set.obj
- Value to set in the Map.forceUseProvidedObjectType
- If true, current type in typed map will be overridden.UtilsException
public Class<?> getType(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public Class<?>[] getGenericTypes(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public Class<?> getGenericCollectionType(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public Class<?> getGenericMapKeyType(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public Class<?> getGenericMapValueType(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public boolean isReadable(IPropertySource source) throws UtilsException
IProperty
source
- Source context to introspect.UtilsException
public boolean isWriteable(IPropertySource target) throws UtilsException
IProperty
target
- Source context to introspect.UtilsException
protected IMethodInvoker getReadMethod(IPropertySource source, boolean mandatory) throws UtilsException
UtilsException
protected IMethodInvoker getWriteMethod(IPropertySource source, boolean mandatory) throws UtilsException
UtilsException
protected Class<?> getWriteMethodParamType(IPropertySource source, boolean mandatory) throws UtilsException
UtilsException
public String getProperty()