Class JcrPluginConfig
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- org.hippoecm.frontend.model.map.AbstractValueMap
-
- org.hippoecm.frontend.plugin.config.impl.JcrPluginConfig
-
- All Implemented Interfaces:
Serializable
,Map<String,Object>
,org.apache.wicket.model.IDetachable
,org.apache.wicket.util.io.IClusterable
,org.apache.wicket.util.value.IValueMap
,IObservable
,IPluginConfig
- Direct Known Subclasses:
JcrClusterConfig
public class JcrPluginConfig extends AbstractValueMap implements IPluginConfig, org.apache.wicket.model.IDetachable
The JCR backed implementation of the plugin configuration. It will try to do type conversion (i.e. string to boolean and vice versa) and single to multiple (and the reverse).It allows wrapping, so that subclasses can intercept the retrieval of values to e.g. interpolate these.
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object,V extends Object>
-
-
Field Summary
Fields Modifier and Type Field Description protected JcrNodeModel
nodeModel
-
Constructor Summary
Constructors Constructor Description JcrPluginConfig(JcrNodeModel nodeModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
detach()
Set<Map.Entry<String,Object>>
entrySet()
boolean
equals(Object other)
Equivalence of observables; observation will only be started on one instance.Object
get(Object key)
boolean
getBoolean(String key)
CharSequence
getCharSequence(String key)
double
getDouble(String key)
double
getDouble(String key, double defaultValue)
Duration
getDuration(String key)
Instant
getInstant(String key)
int
getInt(String key)
int
getInt(String key, int defaultValue)
String
getKey(String key)
long
getLong(String key)
long
getLong(String key, long defaultValue)
String
getName()
The name of the configuration.JcrNodeModel
getNodeModel()
protected IObservationContext<? extends IPluginConfig>
getObservationContext()
IPluginConfig
getPluginConfig(Object key)
Retrieve a child config of a particular name.Set<IPluginConfig>
getPluginConfigSet()
Retrieve a set of child plugin configurations.String
getString(String key)
String
getString(String key, String defaultValue)
String[]
getStringArray(String key)
org.apache.wicket.util.string.StringValue
getStringValue(String key)
int
hashCode()
boolean
isImmutable()
org.apache.wicket.util.value.IValueMap
makeImmutable()
Object
put(String key, Object value)
void
setObservationContext(IObservationContext<? extends IObservable> context)
Before observation is started on the observable, an observation context is injected by the observer registry.void
startObservation()
When the firstIObserver
of this observable is registered with the observer registry, observation is started.void
stopObservation()
When the lastIObserver
unregisters, observation is stopped.protected void
sync()
String
toString()
Generates aString
representation of this object.protected Object
unwrap(Object value)
protected IHippoMap
unwrapConfig(IPluginConfig value)
protected Object
wrap(Object value)
protected JcrPluginConfig
wrapConfig(Node node)
-
Methods inherited from class org.hippoecm.frontend.model.map.AbstractValueMap
add, getAsBoolean, getAsBoolean, getAsDouble, getAsDouble, getAsDuration, getAsDuration, getAsEnum, getAsEnum, getAsEnum, getAsInstant, getAsInteger, getAsInteger, getAsLong, getAsLong, getAsTime, putAll, remove
-
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.util.value.IValueMap
getAsBoolean, getAsBoolean, getAsDouble, getAsDouble, getAsDuration, getAsDuration, getAsEnum, getAsEnum, getAsEnum, getAsInstant, getAsInteger, getAsInteger, getAsLong, getAsLong, getAsTime
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
-
-
-
-
Field Detail
-
nodeModel
protected JcrNodeModel nodeModel
-
-
Constructor Detail
-
JcrPluginConfig
public JcrPluginConfig(JcrNodeModel nodeModel)
-
-
Method Detail
-
sync
protected void sync()
-
getNodeModel
public JcrNodeModel getNodeModel()
-
getName
public String getName()
Description copied from interface:IPluginConfig
The name of the configuration. When the configuration is passed to a plugin, this name is unique within the system. It can therefore be used to construct unique service names.- Specified by:
getName
in interfaceIPluginConfig
-
getBoolean
public boolean getBoolean(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getBoolean
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getBoolean
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getBoolean(String)
-
getDouble
public double getDouble(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getDouble
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getDouble
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getDouble(String)
-
getDouble
public double getDouble(String key, double defaultValue) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getDouble
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getDouble
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getDouble(String, double)
-
getInt
public int getInt(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getInt
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getInt
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getInt(String)
-
getInt
public int getInt(String key, int defaultValue) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getInt
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getInt
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getInt(String, int)
-
getLong
public long getLong(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getLong
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getLong
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getLong(String)
-
getLong
public long getLong(String key, long defaultValue) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getLong
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getLong
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getLong(String, long)
-
getKey
public String getKey(String key)
- Specified by:
getKey
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getKey
in classAbstractValueMap
-
getString
public String getString(String key)
- Specified by:
getString
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getString
in classAbstractValueMap
- See Also:
IValueMap.getString(String)
-
getString
public String getString(String key, String defaultValue)
- Specified by:
getString
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getString
in classAbstractValueMap
- See Also:
IValueMap.getString(String, String)
-
getStringArray
public String[] getStringArray(String key)
- Specified by:
getStringArray
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getStringArray
in classAbstractValueMap
- See Also:
IValueMap.getStringArray(String)
-
getStringValue
public org.apache.wicket.util.string.StringValue getStringValue(String key)
- Specified by:
getStringValue
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getStringValue
in classAbstractValueMap
- See Also:
IValueMap.getStringValue(String)
-
getPluginConfig
public IPluginConfig getPluginConfig(Object key)
Description copied from interface:IPluginConfig
Retrieve a child config of a particular name. In the JCR implementation, this corresponds to a child node of type frontend:pluginconfig.- Specified by:
getPluginConfig
in interfaceIPluginConfig
-
getPluginConfigSet
public Set<IPluginConfig> getPluginConfigSet()
Description copied from interface:IPluginConfig
Retrieve a set of child plugin configurations.- Specified by:
getPluginConfigSet
in interfaceIPluginConfig
-
getCharSequence
public CharSequence getCharSequence(String key)
- Specified by:
getCharSequence
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getCharSequence
in classAbstractValueMap
- See Also:
IValueMap.getCharSequence(String)
-
getDuration
public Duration getDuration(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getDuration
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getDuration
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getDuration(String)
-
getInstant
public Instant getInstant(String key) throws org.apache.wicket.util.string.StringValueConversionException
- Specified by:
getInstant
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
getInstant
in classAbstractValueMap
- Throws:
org.apache.wicket.util.string.StringValueConversionException
- See Also:
IValueMap.getInstant(String)
-
isImmutable
public boolean isImmutable()
- Specified by:
isImmutable
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
isImmutable
in classAbstractValueMap
-
makeImmutable
public org.apache.wicket.util.value.IValueMap makeImmutable()
- Specified by:
makeImmutable
in interfaceorg.apache.wicket.util.value.IValueMap
- Overrides:
makeImmutable
in classAbstractValueMap
-
detach
public void detach()
- Specified by:
detach
in interfaceorg.apache.wicket.model.IDetachable
-
clear
public void clear()
-
equals
public boolean equals(Object other)
Description copied from interface:IObservable
Equivalence of observables; observation will only be started on one instance.- Specified by:
equals
in interfaceIObservable
- Specified by:
equals
in interfaceMap<String,Object>
- Overrides:
equals
in classAbstractMap<String,Object>
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceIObservable
- Specified by:
hashCode
in interfaceMap<String,Object>
- Overrides:
hashCode
in classAbstractMap<String,Object>
- See Also:
IObservable.equals(Object)
-
toString
public String toString()
Description copied from class:AbstractValueMap
Generates aString
representation of this object.- Overrides:
toString
in classAbstractValueMap
- Returns:
String
representation of thisValueMap
consistent with the tag-attribute style of markup elements. For example:a="x" b="y" c="z"
.
-
wrapConfig
protected JcrPluginConfig wrapConfig(Node node)
-
unwrapConfig
protected IHippoMap unwrapConfig(IPluginConfig value)
-
setObservationContext
public void setObservationContext(IObservationContext<? extends IObservable> context)
Description copied from interface:IObservable
Before observation is started on the observable, an observation context is injected by the observer registry. This context can be used to notify listeners.- Specified by:
setObservationContext
in interfaceIObservable
-
getObservationContext
protected IObservationContext<? extends IPluginConfig> getObservationContext()
-
startObservation
public void startObservation()
Description copied from interface:IObservable
When the firstIObserver
of this observable is registered with the observer registry, observation is started. Implementations must notify observers until observation is stopped.An implementation should register listeners with external data sources, when appropriate. It is possible for an observable to register as an observer for another observable.
- Specified by:
startObservation
in interfaceIObservable
-
stopObservation
public void stopObservation()
Description copied from interface:IObservable
When the lastIObserver
unregisters, observation is stopped. Any listeners or observers registered by the observable must be unregistered by the implementation.- Specified by:
stopObservation
in interfaceIObservable
-
-