public class JcrNodeModel extends ItemModelWrapper<javax.jcr.Node> implements IObservable
Node
. It maintains a reference to a (possibly null)
Node object. In addition, it is IObservable
, broadcasting JCR Event
s
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.
Constructor and Description |
---|
JcrNodeModel(JcrItemModel model)
Create a JcrNodeModel based on an JcrItemModel.
|
JcrNodeModel(javax.jcr.Node node)
Create a JcrNodeModel based on a JCR Node.
|
JcrNodeModel(String path)
Create a JcrNodeModel based on an absolute JCR path.
|
Modifier and Type | Method and Description |
---|---|
void |
detach() |
boolean |
equals(Object object)
Equivalence of observables; observation will only be started on one instance.
|
javax.jcr.Node |
getNode()
Retrieve the node from the repository.
|
javax.jcr.Node |
getObject() |
JcrNodeModel |
getParentModel()
Retrieve a JcrNodeModel for the parent node.
|
int |
hashCode() |
void |
setObservationContext(IObservationContext<? extends IObservable> context)
Store the observation context to be used to dispatch events.
|
void |
startObservation()
Start the observation by listening to JCR
Event s. |
void |
stopObservation()
Stop listening to JCR
Event s. |
String |
toString() |
getChainedModel, getItemModel, setChainedModel, setObject
public JcrNodeModel(JcrItemModel model)
model
- the Item modelpublic JcrNodeModel(javax.jcr.Node node)
node
- the node to wrappublic JcrNodeModel(String path)
path
- the JCR path to the Node.public javax.jcr.Node getNode()
public javax.jcr.Node getObject()
getObject
in interface org.apache.wicket.model.IModel<javax.jcr.Node>
getObject
in class ItemModelWrapper<javax.jcr.Node>
public JcrNodeModel getParentModel()
public void detach()
detach
in interface org.apache.wicket.model.IDetachable
detach
in class ItemModelWrapper<javax.jcr.Node>
public void setObservationContext(IObservationContext<? extends IObservable> context)
setObservationContext
in interface IObservable
public void startObservation()
Event
s.startObservation
in interface IObservable
public void stopObservation()
Event
s.stopObservation
in interface IObservable
public boolean equals(Object object)
IObservable
equals
in interface IObservable
equals
in class Object
public int hashCode()
hashCode
in interface IObservable
hashCode
in class Object
IObservable.equals(Object)
Copyright © 2007–2016 Hippo B.V. (http://www.onehippo.com). All rights reserved.