public class ReflectiveAdapter<T> extends Object implements ConfigTypeAdapter<T,Map<String,Object>>
Modifier and Type | Field and Description |
---|---|
private static Logger |
log |
private T |
providedConfObj |
Constructor and Description |
---|
ReflectiveAdapter()
stateless
|
ReflectiveAdapter(T providedConfigurationObjectInstance)
stateful
|
Modifier and Type | Method and Description |
---|---|
T |
fromConfigNode(Map<String,Object> configNode,
ConfigProperty property,
LoadingContext ctx,
Object parent)
Converts serialized configuration representation to the type provided by this adaptor.
|
Map<String,Object> |
getSchema(ConfigProperty property,
ProcessingContext ctx)
Returns a metadata node in json-schema format (http://json-schema.org/)
Additional proprietary optional schema parameters:
essentialType - e.g., "base64" for type string class - simple name of the ConfigurableClass if this is a corresponding object mapkey - container that denotes schema for the key (type will always be string, but there could be essentialType, etc) |
private void |
injectParent(LoadingContext ctx,
Class<T> clazz,
T confObj,
Object parent,
String uuid) |
Map<String,Object> |
normalize(Object configNode,
ConfigProperty property,
ProcessingContext ctx)
Converts allowed representations (e.g., "123" for Integer) to proper serialized representation
|
private void |
populate(Map<String,Object> configNode,
LoadingContext ctx,
Class<T> clazz,
T confObj,
Object parent,
String uuid) |
private void |
populateFields(Map<String,Object> configNode,
LoadingContext ctx,
Class<T> clazz,
T confObj) |
Map<String,Object> |
toConfigNode(T object,
ConfigProperty property,
SavingContext ctx)
Creates a serialized configuration representation for a provided object.
|
private T providedConfObj
public ReflectiveAdapter()
public ReflectiveAdapter(T providedConfigurationObjectInstance)
public T fromConfigNode(Map<String,Object> configNode, ConfigProperty property, LoadingContext ctx, Object parent) throws ConfigurationException
ConfigTypeAdapter
fromConfigNode
in interface ConfigTypeAdapter<T,Map<String,Object>>
property
- the property which is going to be assigned the returned value (Can be null)ConfigurationException
private void populate(Map<String,Object> configNode, LoadingContext ctx, Class<T> clazz, T confObj, Object parent, String uuid)
private void populateFields(Map<String,Object> configNode, LoadingContext ctx, Class<T> clazz, T confObj)
private void injectParent(LoadingContext ctx, Class<T> clazz, T confObj, Object parent, String uuid)
public Map<String,Object> toConfigNode(T object, ConfigProperty property, SavingContext ctx) throws ConfigurationException
ConfigTypeAdapter
Creates a serialized configuration representation for a provided object. Throws ConfigurationUnserializableException when the object allows configuration with setters in which case it is impossible to trace the parameters used in the setters back.
toConfigNode
in interface ConfigTypeAdapter<T,Map<String,Object>>
ctx
- @returnConfigurationException
public Map<String,Object> getSchema(ConfigProperty property, ProcessingContext ctx) throws ConfigurationException
ConfigTypeAdapter
getSchema
in interface ConfigTypeAdapter<T,Map<String,Object>>
ConfigurationException
public Map<String,Object> normalize(Object configNode, ConfigProperty property, ProcessingContext ctx) throws ConfigurationException
ConfigTypeAdapter
normalize
in interface ConfigTypeAdapter<T,Map<String,Object>>
ConfigurationException
Copyright © 2017 dcm4che.org. All rights reserved.