org.nodal.util
Class NodeFilter

java.lang.Object
  extended byorg.nodal.util.NodeFilter
All Implemented Interfaces:
Node
Direct Known Subclasses:
BareContent, BareContent.Editor, MapFilter, RecordFilter, SequenceFilter

public class NodeFilter
extends java.lang.Object
implements Node

Filter for implementing aspects of Node interface.

This class is intended to be inherited in order to implement functionality on top of a basic Node. After encapsulating some other Node, it allows a developer to selectively override methods that, by default, simply pass on to the base Node.

Author:
Lee Iverson
See Also:
Node

Field Summary
protected  Node node
           
 
Constructor Summary
protected NodeFilter(Node n)
           
 
Method Summary
 AnchorNode asAnchor()
          An AnchorNode interface if this Node is an anchor, otherwise null.
 MapNode asMapNode()
          The Node's contents expressed as a Map.
 RecordNode asRecordNode()
          The Node's contents expressed as a Record.
 SequenceNode asSequenceNode()
          The Node's contents expressed as a Sequence.
 Node bareNode()
          The canonical "bare" instance of this Node.
 Capability capability()
          A Capability describing the User's current permissions for this Node.
 NodeContent content()
          The Node's contents.
 NodeContent.Editor edit()
          An Editor for changing the Content of this Node.
 MapNode.Editor editMap()
          This NodeEditor as a MapEditor.
 RecordNode.Editor editRecord()
          This NodeEditor as a RecordEditor.
 SequenceNode.Editor editSequence()
          This NodeEditor as a SequenceEditor.
 NodeHistory history()
          The Node's history.
 Name id()
          The Node's global identity expressed as a Name.
 Path path()
          An absolute Path that is bound to this Node.
 Repository repository()
          The Repository containing this Node.
 NodeType type()
          The data Type of the Node's contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

node

protected final Node node
Constructor Detail

NodeFilter

protected NodeFilter(Node n)
Method Detail

repository

public Repository repository()
Description copied from interface: Node
The Repository containing this Node.

Specified by:
repository in interface Node

id

public Name id()
Description copied from interface: Node
The Node's global identity expressed as a Name.

Specified by:
id in interface Node

type

public NodeType type()
Description copied from interface: Node
The data Type of the Node's contents.

Specified by:
type in interface Node

path

public Path path()
Description copied from interface: Node
An absolute Path that is bound to this Node.

Specified by:
path in interface Node

capability

public Capability capability()
Description copied from interface: Node
A Capability describing the User's current permissions for this Node.

Specified by:
capability in interface Node

bareNode

public Node bareNode()
Description copied from interface: Node
The canonical "bare" instance of this Node.

A "bare" instance is the instance of this Node that is not a NodeContent, NodeEditor or NodeHistory instance and that has a trivial, direct Path.

Specified by:
bareNode in interface Node

content

public NodeContent content()
Description copied from interface: Node
The Node's contents.

If the Capability does not provide read access, then this will return null.

Specified by:
content in interface Node

asMapNode

public MapNode asMapNode()
Description copied from interface: Node
The Node's contents expressed as a Map. This is a shortcut for content().asMap().

Specified by:
asMapNode in interface Node

asSequenceNode

public SequenceNode asSequenceNode()
Description copied from interface: Node
The Node's contents expressed as a Sequence. This is a shortcut for content().asSequence().

Specified by:
asSequenceNode in interface Node

asRecordNode

public RecordNode asRecordNode()
Description copied from interface: Node
The Node's contents expressed as a Record. This is a shortcut for content().asRecord().

Specified by:
asRecordNode in interface Node

history

public NodeHistory history()
Description copied from interface: Node
The Node's history.

If the Capability does not provide history access, then this will return null.

Specified by:
history in interface Node

asAnchor

public AnchorNode asAnchor()
Description copied from interface: Node
An AnchorNode interface if this Node is an anchor, otherwise null.

Specified by:
asAnchor in interface Node
Returns:
an AnchorNode interface if this Node is an anchor

edit

public NodeContent.Editor edit()
Description copied from interface: Node
An Editor for changing the Content of this Node. If the Capability does not provide write access, then this will return null.

Specified by:
edit in interface Node

editMap

public MapNode.Editor editMap()
Description copied from interface: Node
This NodeEditor as a MapEditor.

Returns null if the type is not MapType.

Specified by:
editMap in interface Node

editRecord

public RecordNode.Editor editRecord()
Description copied from interface: Node
This NodeEditor as a RecordEditor.

Returns null if the type is not RecordType.

Specified by:
editRecord in interface Node

editSequence

public SequenceNode.Editor editSequence()
Description copied from interface: Node
This NodeEditor as a SequenceEditor.

Returns null if the type is not SequenceType.

Specified by:
editSequence in interface Node