Class JcrNodeModel

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.model.IDetachable, org.apache.wicket.model.IModel<Node>, org.apache.wicket.util.io.IClusterable, IObservable

    public class JcrNodeModel
    extends ItemModelWrapper<Node>
    implements IObservable
    The model for a JCR Node. It maintains a reference to a (possibly null) Node object. In addition, it is IObservable, broadcasting JCR Events for property changes and child node additions or removals.

    In general, no guarantees are made on the existence of the Node. I.e. the referenced node may disappear or it may even never have existed.

    See Also:
    Serialized Form
    • Constructor Detail

      • JcrNodeModel

        public JcrNodeModel​(JcrItemModel model)
        Create a JcrNodeModel based on an JcrItemModel. The JcrItemModel should provide access to the Node to be wrapped by this model.
        Parameters:
        model - the Item model
      • JcrNodeModel

        public JcrNodeModel​(Node node)
        Create a JcrNodeModel based on a JCR Node.
        Parameters:
        node - the node to wrap
      • JcrNodeModel

        public JcrNodeModel​(String path)
        Create a JcrNodeModel based on an absolute JCR path.
        Parameters:
        path - the JCR path to the Node.
    • Method Detail

      • getNode

        public Node getNode()
        Retrieve the node from the repository. May return null when the node no longer exists or the model was initially created with a null object.
      • getParentModel

        public JcrNodeModel getParentModel()
        Retrieve a JcrNodeModel for the parent node.
        Returns:
        a model for the parent Node
      • detach

        public void detach()
        Specified by:
        detach in interface org.apache.wicket.model.IDetachable
        Specified by:
        detach in interface org.apache.wicket.model.IModel<Node>
        Overrides:
        detach in class ItemModelWrapper<Node>
      • equals

        public boolean equals​(Object object)
        Description copied from interface: IObservable
        Equivalence of observables; observation will only be started on one instance.
        Specified by:
        equals in interface IObservable
        Overrides:
        equals in class Object