org.nodal.util
Class MapFilter

java.lang.Object
  extended byorg.nodal.util.NodeFilter
      extended byorg.nodal.util.MapFilter
All Implemented Interfaces:
Content, MapContent, MapNode, Node, NodeContent, TxnMonitorable

public abstract class MapFilter
extends NodeFilter
implements MapNode

Combine Node and MapContent interfaces to create the Map interface.

This class takes a Node interface and a MapContent interface and aggregates their interfaces to create the Map interface. It can be used all by itself or inherited so as to provide a filter upon which particular methods can be selectively overridden.

Author:
Lee Iverson

Nested Class Summary
 
Nested classes inherited from class org.nodal.model.MapNode
MapNode.Editor
 
Field Summary
protected  MapContent map
           
 
Fields inherited from class org.nodal.util.NodeFilter
node
 
Constructor Summary
protected MapFilter(Node n, MapContent r)
           
 
Method Summary
 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.
 NodeContent content()
          The Node's contents.
abstract  NodeContent.Editor edit()
          An Editor for changing the Content of this Node.
 java.util.Iterator properties()
          A sequence of all of the properties currently indexing the contents if this Content.
 int size()
          The number of properties contained in this Content object.
 Getter value(java.lang.Object obj)
          A generic Getter for property values, given a property.
 
Methods inherited from class org.nodal.util.NodeFilter
asAnchor, bareNode, capability, editMap, editRecord, editSequence, history, id, path, repository, type
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nodal.model.MapNode
editMap
 
Methods inherited from interface org.nodal.model.MapContent
asMap
 
Methods inherited from interface org.nodal.model.Content
getValue, invert, isValidProperty, type
 
Methods inherited from interface org.nodal.model.Node
asAnchor, bareNode, capability, editRecord, editSequence, history, id, path, repository, type
 
Methods inherited from interface org.nodal.model.TxnMonitorable
addTxnHandler, removeTxnHandler
 

Field Detail

map

protected MapContent map
Constructor Detail

MapFilter

protected MapFilter(Node n,
                    MapContent r)
Method Detail

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
Overrides:
content in class NodeFilter

size

public int size()
Description copied from interface: Content
The number of properties contained in this Content object.

Specified by:
size in interface Content

properties

public java.util.Iterator properties()
Description copied from interface: Content
A sequence of all of the properties currently indexing the contents if this Content.

Specified by:
properties in interface Content

value

public Getter value(java.lang.Object obj)
             throws PropertyConstraintFailure
Description copied from interface: Content
A generic Getter for property values, given a property.

Will throw an exception if the property type is invalid, but not if the property is not available in this Node's content. This way, a value Getter can be established in anticipation of the addition of a property.

Specified by:
value in interface Content
Parameters:
obj - the Object that identifies this property
Throws:
PropertyConstraintFailure

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
Overrides:
asMapNode in class NodeFilter

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
Overrides:
asRecordNode in class NodeFilter

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
Overrides:
asSequenceNode in class NodeFilter

edit

public abstract 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
Overrides:
edit in class NodeFilter