|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lumis.doui.source.AbstractSourceData
@StableMinor(version="5.5", sinceVersion="4.0") public abstract class AbstractSourceData
Abstract implementation of a ISourceData
that implements the default
convertion behaviour. This convertion behaviour assumes the key is equals
to the field id in the source.
This implementation does no conversion during
the put method, it does conversion only during the get method. But it offers
the convertValue(String, Class, Object)
method to be used by
it subclasses in the put implementation.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected Source |
source
The source this source data belongs to. |
Constructor Summary | |
---|---|
protected |
AbstractSourceData()
Creates a source data without source associated. |
protected |
AbstractSourceData(Source source)
Creates a source data associated with the given source. |
Method Summary | ||
---|---|---|
protected
|
convertValue(String key,
Class<T> expectedClass,
Object value)
Converts a value that is associated with a given key. |
|
|
get(Object key,
Class<T> expectedClass)
Returns a data value, converted to the expected class. |
|
protected Class<?> |
getValueClass(String key)
Returns the class the value of the given key is to be kept as. |
|
void |
putAll(Map<? extends String,? extends Object> t)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, remove, size, values |
Field Detail |
---|
protected final Source source
Constructor Detail |
---|
protected AbstractSourceData(Source source)
source
- the source that this data will belong to.protected AbstractSourceData()
source
- the source that this data will belong to.Method Detail |
---|
protected <T> T convertValue(String key, Class<T> expectedClass, Object value)
T
- the expected return class.key
- the key.expectedClass
- the expected return class.value
- the value to be converted.
protected Class<?> getValueClass(String key)
key
- the key.
public <T> T get(Object key, Class<T> expectedClass)
ISourceData
get
in interface ISourceData
T
- the expected class.key
- the data entry key.expectedClass
- the expected class.
public void putAll(Map<? extends String,? extends Object> t)
putAll
in interface Map<String,Object>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |