Class PropertiesFactory

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(IPropertiesChangeListener listener)
      Add a listener which will be called when a change to the underlying resource stream (e.g.
      protected void addToWatcher​(java.lang.String path, org.apache.wicket.util.resource.IResourceStream resourceStream, org.apache.wicket.util.watch.IModificationWatcher watcher)
      Add the resource stream to the file being watched
      void clearCache()
      Remove all cached properties.
      protected java.util.Map<java.lang.String,​Properties> getCache()
      For subclasses to get access to the cache
      java.util.List<IPropertiesLoader> getPropertiesLoaders()
      Gets the List of properties loader.
      Properties load​(java.lang.Class<?> clazz, java.lang.String path)
      Load the properties associated with the path
      protected org.apache.wicket.util.value.ValueMap loadFromLoader​(IPropertiesLoader loader, org.apache.wicket.util.resource.IResourceStream resourceStream)  
      protected java.util.Map<java.lang.String,​Properties> newPropertiesCache()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertiesFactory

        public PropertiesFactory​(IPropertiesFactoryContext context)
        Construct.
        Parameters:
        context - context for properties factory
    • Method Detail

      • getPropertiesLoaders

        public java.util.List<IPropertiesLoader> getPropertiesLoaders()
        Gets the List of properties loader. You may add or remove properties loaders at your will.
        Returns:
        the List of properties loader
      • newPropertiesCache

        protected java.util.Map<java.lang.String,​Properties> newPropertiesCache()
        Returns:
        new Cache implementation
      • loadFromLoader

        protected org.apache.wicket.util.value.ValueMap loadFromLoader​(IPropertiesLoader loader,
                                                                       org.apache.wicket.util.resource.IResourceStream resourceStream)
        Parameters:
        loader -
        resourceStream -
        Returns:
        properties
      • addToWatcher

        protected void addToWatcher​(java.lang.String path,
                                    org.apache.wicket.util.resource.IResourceStream resourceStream,
                                    org.apache.wicket.util.watch.IModificationWatcher watcher)
        Add the resource stream to the file being watched
        Parameters:
        path -
        resourceStream -
        watcher -
      • getCache

        protected final java.util.Map<java.lang.String,​Properties> getCache()
        For subclasses to get access to the cache
        Returns:
        Map