Class 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:
  • Field Details

  • Constructor Details

    • JcrPluginConfig

      public JcrPluginConfig(JcrNodeModel nodeModel)
  • Method Details

    • 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 interface IPluginConfig
    • getBoolean

      public boolean getBoolean(String key) throws org.apache.wicket.util.string.StringValueConversionException
      Specified by:
      getBoolean in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getBoolean in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getDouble in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getDouble in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getInt in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getInt in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getLong in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getLong in class AbstractValueMap
      Throws:
      org.apache.wicket.util.string.StringValueConversionException
      See Also:
      • IValueMap.getLong(String, long)
    • getKey

      public String getKey(String key)
      Specified by:
      getKey in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getKey in class AbstractValueMap
    • getString

      public String getString(String key)
      Specified by:
      getString in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getString in class AbstractValueMap
      See Also:
      • IValueMap.getString(String)
    • getString

      public String getString(String key, String defaultValue)
      Specified by:
      getString in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getString in class AbstractValueMap
      See Also:
      • IValueMap.getString(String, String)
    • getStringArray

      public String[] getStringArray(String key)
      Specified by:
      getStringArray in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getStringArray in class AbstractValueMap
      See Also:
      • IValueMap.getStringArray(String)
    • getStringValue

      public org.apache.wicket.util.string.StringValue getStringValue(String key)
      Specified by:
      getStringValue in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getStringValue in class AbstractValueMap
      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 interface IPluginConfig
    • getPluginConfigSet

      public Set<IPluginConfig> getPluginConfigSet()
      Description copied from interface: IPluginConfig
      Retrieve a set of child plugin configurations.
      Specified by:
      getPluginConfigSet in interface IPluginConfig
    • getCharSequence

      public CharSequence getCharSequence(String key)
      Specified by:
      getCharSequence in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getCharSequence in class AbstractValueMap
      See Also:
      • IValueMap.getCharSequence(String)
    • getDuration

      public Duration getDuration(String key) throws org.apache.wicket.util.string.StringValueConversionException
      Specified by:
      getDuration in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getDuration in class AbstractValueMap
      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 interface org.apache.wicket.util.value.IValueMap
      Overrides:
      getInstant in class AbstractValueMap
      Throws:
      org.apache.wicket.util.string.StringValueConversionException
      See Also:
      • IValueMap.getInstant(String)
    • isImmutable

      public boolean isImmutable()
      Specified by:
      isImmutable in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      isImmutable in class AbstractValueMap
    • makeImmutable

      public org.apache.wicket.util.value.IValueMap makeImmutable()
      Specified by:
      makeImmutable in interface org.apache.wicket.util.value.IValueMap
      Overrides:
      makeImmutable in class AbstractValueMap
    • detach

      public void detach()
      Specified by:
      detach in interface org.apache.wicket.model.IDetachable
    • get

      public Object get(Object key)
      Specified by:
      get in interface Map<String,Object>
      Overrides:
      get in class AbstractMap<String,Object>
    • put

      public Object put(String key, Object value)
      Specified by:
      put in interface Map<String,Object>
      Overrides:
      put in class AbstractMap<String,Object>
    • clear

      public void clear()
      Specified by:
      clear in interface Map<String,Object>
      Overrides:
      clear in class AbstractValueMap
    • entrySet

      public Set<Map.Entry<String,Object>> entrySet()
      Specified by:
      entrySet in interface Map<String,Object>
      Specified by:
      entrySet in class AbstractMap<String,Object>
    • 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 interface IObservable
      Specified by:
      equals in interface Map<String,Object>
      Overrides:
      equals in class AbstractMap<String,Object>
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface IObservable
      Specified by:
      hashCode in interface Map<String,Object>
      Overrides:
      hashCode in class AbstractMap<String,Object>
      See Also:
    • toString

      public String toString()
      Description copied from class: AbstractValueMap
      Generates a String representation of this object.
      Overrides:
      toString in class AbstractValueMap
      Returns:
      String representation of this ValueMap 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)
    • wrap

      protected Object wrap(Object value)
    • unwrap

      protected Object unwrap(Object 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 interface IObservable
    • getObservationContext

      protected IObservationContext<? extends IPluginConfig> getObservationContext()
    • startObservation

      public void startObservation()
      Description copied from interface: IObservable
      When the first IObserver 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 interface IObservable
    • stopObservation

      public void stopObservation()
      Description copied from interface: IObservable
      When the last IObserver unregisters, observation is stopped. Any listeners or observers registered by the observable must be unregistered by the implementation.
      Specified by:
      stopObservation in interface IObservable