org.mmbase.bridge.util
Class AnnotatedNode<A>

java.lang.Object
  extended by org.mmbase.bridge.util.NodeWrapper
      extended by org.mmbase.bridge.util.AnnotatedNode<A>
All Implemented Interfaces:
Comparable<Node>, Node

public class AnnotatedNode<A>
extends NodeWrapper

An annotated node is an object that wraps another Node but wich can be annotated with some extra information. This information can be retrieved by getAnnotation(java.lang.String), or as a matter of convience in e.g. JSPs using getValue(java.lang.String) with a field name starting with "annotation:".

Since:
MMBase-1.9
Version:
$Id: AnnotatedNode.java 37997 2009-08-18 16:56:38Z michiel $
Author:
Michiel Meeuwissen

Field Summary
 
Fields inherited from class org.mmbase.bridge.util.NodeWrapper
node
 
Fields inherited from interface org.mmbase.bridge.Node
CLOUD_COMMITNODE_KEY
 
Constructor Summary
AnnotatedNode(Node n)
           
 
Method Summary
 A getAnnotation(String a)
           
 Object getValue(String fieldName)
          Returns the value of the specified field as an object.
 A putAnnotation(String a, A o)
           
 
Methods inherited from class org.mmbase.bridge.util.NodeWrapper
cancel, commit, compareTo, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, createParameters, createRelation, delete, delete, deleteAlias, deleteRelations, deleteRelations, equals, getAliases, getBooleanValue, getByteValue, getChanged, getCloud, getContext, getDateValue, getDecimalValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctions, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNode, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getSize, getStringValue, getValueWithoutProcess, getXMLValue, getXMLValue, hashCode, hasRelations, isChanged, isChanged, isNew, isNodeManager, isNull, isRelation, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeManager, setNodeValue, setObjectValue, setStringValue, setValue, setValueWithoutProcess, setXMLValue, toNodeManager, toRelation, toRelationManager, toString, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotatedNode

public AnnotatedNode(Node n)
Method Detail

getAnnotation

public A getAnnotation(String a)

putAnnotation

public A putAnnotation(String a,
                       A o)

getValue

public Object getValue(String fieldName)
Description copied from interface: Node
Returns the value of the specified field as an object. For example a field of type int is returned as an Integer. The object type may vary and is dependent on how data was stored in a field. I.e. It may be possible for an Integer field to return it's value as a String if it was stored that way in the first place.

Specified by:
getValue in interface Node
Overrides:
getValue in class NodeWrapper
Parameters:
fieldName - the name of the field to be returned
Returns:
the value of the specified field


MMBase 2.0-SNAPSHOT - null