public class SimpleConfigurationAdapter extends AbstractLocalConfiguration<SimpleConfiguration> implements SimpleConfiguration
SimpleConfiguration
.SimpleConfiguration
Modifier and Type | Field and Description |
---|---|
protected DocumentModel |
detachedDocument |
protected Map<String,String> |
parameters |
SIMPLE_CONFIGURATION_FACET, SIMPLE_CONFIGURATION_PARAMETER_KEY, SIMPLE_CONFIGURATION_PARAMETER_VALUE, SIMPLE_CONFIGURATION_PARAMETERS_PROPERTY, SIMPLE_CONFIGURATION_SCHEMA
Constructor and Description |
---|
SimpleConfigurationAdapter(DocumentModel doc) |
Modifier and Type | Method and Description |
---|---|
boolean |
canMerge()
Returns
true if this LocalConfiguration accepted to be merged with a parent configuration,
false otherwise. |
protected List<Map<String,String>> |
computeParametersForDocument(Map<String,String> parameters) |
protected Map<String,String> |
computeParametersFromDocument(DocumentModel doc) |
String |
get(String key)
Returns the value to which the specified
key is mapped, or null if there is no mapping for the
key . |
String |
get(String key,
String defaultValue)
Returns the value to which the specified key is mapped, or the given default value if there is no mapping for the
key.
|
DocumentRef |
getDocumentRef()
Returns the related
DocumentRef of this local configuration. |
protected void |
loadFromDocument(DocumentModel doc) |
SimpleConfiguration |
merge(SimpleConfiguration other)
Merge this
LocalConfiguration with another one. |
String |
put(String key,
String value)
Associates the specified value with the specified key.
|
void |
putAll(Map<String,String> parameters)
Copies all of the parameters from the specified map to this Simple configuration
|
void |
save(CoreSession session)
Save this LocalConfiguration.
|
protected DocumentModel detachedDocument
protected Map<String,String> parameters
public SimpleConfigurationAdapter(DocumentModel doc)
protected void loadFromDocument(DocumentModel doc)
protected Map<String,String> computeParametersFromDocument(DocumentModel doc)
public String get(String key)
SimpleConfiguration
key
is mapped, or null
if there is no mapping for the
key
.get
in interface SimpleConfiguration
key
- the key whose associated value is to be returnedpublic String get(String key, String defaultValue)
SimpleConfiguration
get
in interface SimpleConfiguration
key
- the key whose associated value is to be returneddefaultValue
- the value returned if there is no mapping for the keypublic String put(String key, String value)
SimpleConfiguration
If the map previously contained a mapping for the key, the old value is replaced by the specified value.
put
in interface SimpleConfiguration
key
- key with which the specified value is to be associatedvalue
- value to be associated with the specified keykey
, or null
if there was no mapping for key
.public void putAll(Map<String,String> parameters)
SimpleConfiguration
putAll
in interface SimpleConfiguration
parameters
- parameters to be stored in this Simple configurationpublic DocumentRef getDocumentRef()
LocalConfiguration
DocumentRef
of this local configuration.getDocumentRef
in interface LocalConfiguration<SimpleConfiguration>
public boolean canMerge()
LocalConfiguration
true
if this LocalConfiguration
accepted to be merged with a parent configuration,
false
otherwise.canMerge
in interface LocalConfiguration<SimpleConfiguration>
canMerge
in class AbstractLocalConfiguration<SimpleConfiguration>
public SimpleConfiguration merge(SimpleConfiguration other)
LocalConfiguration
LocalConfiguration
with another one.merge
in interface LocalConfiguration<SimpleConfiguration>
merge
in class AbstractLocalConfiguration<SimpleConfiguration>
public void save(CoreSession session)
LocalConfiguration
save
in interface LocalConfiguration<SimpleConfiguration>
save
in class AbstractLocalConfiguration<SimpleConfiguration>
Copyright © 2018 Nuxeo. All rights reserved.