Class LoadableModel<T>

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.model.IDetachable, org.apache.wicket.model.IModel<T>, org.apache.wicket.util.io.IClusterable
    Direct Known Subclasses:
    CountableLoadableModel, NonEmptyLoadableModel

    public abstract class LoadableModel<T>
    extends Object
    implements org.apache.wicket.model.IModel<T>
    Lazy loading Wicket model. This is an IModel implementation that loads the model content only when needed. This is supposed to be used for objects that are expensive to load. So we can avoid loading the at all when a component that uses them is not visible.
    Author:
    lazyman
    See Also:
    Serialized Form
    • Constructor Detail

      • LoadableModel

        public LoadableModel()
      • LoadableModel

        public LoadableModel​(boolean alwaysReload)
      • LoadableModel

        public LoadableModel​(T object)
      • LoadableModel

        public LoadableModel​(T object,
                             boolean alwaysReload)
    • Method Detail

      • getObject

        public T getObject()
        Specified by:
        getObject in interface org.apache.wicket.model.IModel<T>
      • setObject

        public void setObject​(T object)
        Specified by:
        setObject in interface org.apache.wicket.model.IModel<T>
      • isLoaded

        public boolean isLoaded()
      • reset

        public void reset()
      • detach

        public void detach()
        Specified by:
        detach in interface org.apache.wicket.model.IDetachable
        Specified by:
        detach in interface org.apache.wicket.model.IModel<T>
      • getNestedModel

        public org.apache.wicket.model.IModel getNestedModel()
      • load

        protected abstract T load()
      • onLoad

        protected void onLoad()
      • onDetach

        protected void onDetach()