org.nodal.model
Interface Node

All Known Subinterfaces:
AnchorNode, MapNode, MapNode.Editor, NodeContent, NodeContent.Editor, NodeHistory, NodeVersion, RecordNode, RecordNode.Editor, SequenceNode, SequenceNode.Editor
All Known Implementing Classes:
BareContent, BareContent.Editor, BareMap, BareRecord, BareSequence, MapFilter, NodeFilter, RecordFilter, SequenceFilter

public interface Node

The fundamental unit of data in the NODAL data model.

The Node is the fundamental unit of data in the NODAL data model. It represents both the fundamental unit of addressability, granularity of storage, permission management and history.

The Node interface is essentially a meeting place for all of these different roles, presenting only enough information to allow for identification of a Node object and a set of methods for accessing other (possibly restricted access) interfaces that represent these other roles.

As an addressible unit, every Node has a unique identifer known as the NID or Node id. It is a globally unique Name that is bound to this Node object. It also has a fixed Type, that identifies the kind of collection represented by its Content. Both of these properties are established at the time of creation and are accessible directly via the Node interface.

Author:
Lee Iverson

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.
 

Method Detail

repository

public Repository repository()
The Repository containing this Node.


path

public Path path()
An absolute Path that is bound to this Node.


capability

public Capability capability()
A Capability describing the User's current permissions for this Node.


id

public Name id()
The Node's global identity expressed as a Name.


type

public NodeType type()
The data Type of the Node's contents.


bareNode

public Node bareNode()
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.


content

public NodeContent content()
The Node's contents.

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


asMapNode

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


asSequenceNode

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


asRecordNode

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


edit

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


editMap

public MapNode.Editor editMap()
This NodeEditor as a MapEditor.

Returns null if the type is not MapType.


editRecord

public RecordNode.Editor editRecord()
This NodeEditor as a RecordEditor.

Returns null if the type is not RecordType.


editSequence

public SequenceNode.Editor editSequence()
This NodeEditor as a SequenceEditor.

Returns null if the type is not SequenceType.


history

public NodeHistory history()
The Node's history.

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


asAnchor

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

Returns:
an AnchorNode interface if this Node is an anchor