public class DefaultReferenceAdapter extends Object implements ConfigTypeAdapter
Modifier and Type | Field and Description |
---|---|
private static Logger |
log |
private Map<String,String> |
metadata |
private static PathPattern |
uuidReferencePath |
Constructor and Description |
---|
DefaultReferenceAdapter() |
Modifier and Type | Method and Description |
---|---|
Object |
fromConfigNode(Object configNode,
ConfigProperty property,
LoadingContext ctx,
Object parent)
Converts serialized configuration representation to the type provided by this adaptor.
|
private Object |
getReferencedConfigurableObject(String uuid,
LoadingContext ctx,
ConfigProperty property) |
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) |
Object |
normalize(Object configNode,
ConfigProperty property,
ProcessingContext ctx)
Converts allowed representations (e.g., "123" for Integer) to proper serialized representation
|
private Object |
resolveDeprecatedReference(String configNode,
ConfigProperty property,
LoadingContext ctx) |
Object |
toConfigNode(Object object,
ConfigProperty property,
SavingContext ctx)
Creates a serialized configuration representation for a provided object.
|
private static final PathPattern uuidReferencePath
public DefaultReferenceAdapter()
public Object fromConfigNode(Object configNode, ConfigProperty property, LoadingContext ctx, Object parent) throws ConfigurationException
ConfigTypeAdapter
fromConfigNode
in interface ConfigTypeAdapter
property
- the property which is going to be assigned the returned value (Can be null)ConfigurationException
private Object resolveDeprecatedReference(String configNode, ConfigProperty property, LoadingContext ctx)
private Object getReferencedConfigurableObject(String uuid, LoadingContext ctx, ConfigProperty property)
public Object toConfigNode(Object 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
ctx
- @returnConfigurationException
public Map<String,Object> getSchema(ConfigProperty property, ProcessingContext ctx) throws ConfigurationException
ConfigTypeAdapter
getSchema
in interface ConfigTypeAdapter
ConfigurationException
public Object normalize(Object configNode, ConfigProperty property, ProcessingContext ctx) throws ConfigurationException
ConfigTypeAdapter
normalize
in interface ConfigTypeAdapter
ConfigurationException
Copyright © 2017 dcm4che.org. All rights reserved.