com.vinculumtech.platform.docmodel
Class Node

java.lang.Object
  extended bycom.vinculumtech.platform.docmodel.Node
Direct Known Subclasses:
BaseImageableNode, ImageNode, ListNode, MapNode

public abstract class Node
extends java.lang.Object

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/platform/docmodel/Node.java#6 $

Field Summary
protected static java.util.List EMPTY_LIST
           
static java.lang.String METADATA_DECLARED_TYPE
           
 
Constructor Summary
protected Node(DocumentModel documentModel, java.lang.Object value)
          For now all subclasses must use this signature on the only ctor
 
Method Summary
 void addNodeListener(NodeListener nodeListener)
           
 void applyPathMap(java.util.Map pathMap)
           
 java.util.Map createLocalPathMap()
           
protected abstract  java.util.List createLocalPaths()
          Returns an Unmodifiable List of paths to local children values.
protected  java.lang.Class getDeclaredFieldType(java.lang.String path)
           
 java.lang.Object getDefaultNodeValue()
           
 java.lang.Object getDefaultValueAtLocal(java.lang.String path)
           
 DocumentModel getDocumentModel()
           
 java.util.Map getLocalPathMap()
           
 java.util.List getLocalPaths()
           
 java.lang.Object getMetaDataAt(java.lang.String path, java.lang.String identifier)
          Returns the Class for the position specified by the given path.
protected  java.lang.Object getMetaDataAtLocal(java.lang.String path, java.lang.String identifier, boolean delegatedByChildCollection)
           
protected abstract  java.lang.Object getMetaDataAtLocalInternal(java.lang.String path, java.lang.String identifier, boolean delegatedByChildCollection)
          Should be overriden by subclass
 java.util.List getNodeListeners()
           
 java.lang.Object getNodeValue()
           
 java.util.Map getPathMap(int depth, boolean dependentsInclusive)
           
 java.util.Map getPathMap(int depth, boolean dependentsInclusive, boolean leavesOnly)
           
 java.util.Map getPathMap(int depth, boolean dependentsInclusive, boolean leavesOnly, java.lang.String matches)
          A depth of 1 returns localChildren paths and thier values only only.
 java.lang.Object getValueAt(java.lang.String path)
           
 java.lang.Object getValueAt(java.lang.String path, boolean returnDefaultOnNull)
           
protected  java.lang.Object getValueAtLocal(java.lang.String path)
           
protected abstract  java.lang.Object getValueAtLocalInternal(java.lang.String path)
          Should be overriden by subclass
 boolean hasNodeListener(NodeListener nodeListener)
           
 boolean hasNodeListeners()
           
 boolean isCollectionNode()
           
 boolean isDeleted()
           
abstract  boolean isDependent()
           
 boolean isFindMetaDataInCollectionParent()
           
protected  java.lang.Object makeCoercedValue(java.lang.String path, java.lang.Object value)
           
protected  java.lang.String makePath(java.lang.String pathRoot, java.lang.String currentPath)
           
 void markDeleted()
           
 void removeNodeListener(NodeListener nodeListener)
           
 void setDocumentModel(DocumentModel documentModel)
           
 void setFindMetaDataInCollectionParent(boolean findMetaDataInCollectionParent)
           
 void setIsDeleted(boolean isDeleted)
           
protected  void setLocalPaths(java.util.List localPaths)
           
 void setNodeValue(java.lang.Object nodeValue)
           
 java.lang.Object setValueAt(java.lang.String path, java.lang.Object value)
           
protected  java.lang.Object setValueAtLocal(java.lang.String path, java.lang.Object value)
           
protected abstract  java.lang.Object setValueAtLocalInternal(java.lang.String path, java.lang.Object value)
          Should be overriden by subclass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METADATA_DECLARED_TYPE

public static final java.lang.String METADATA_DECLARED_TYPE
See Also:
Constant Field Values

EMPTY_LIST

protected static final java.util.List EMPTY_LIST
Constructor Detail

Node

protected Node(DocumentModel documentModel,
               java.lang.Object value)
For now all subclasses must use this signature on the only ctor

Method Detail

isFindMetaDataInCollectionParent

public boolean isFindMetaDataInCollectionParent()

setFindMetaDataInCollectionParent

public void setFindMetaDataInCollectionParent(boolean findMetaDataInCollectionParent)

getDocumentModel

public DocumentModel getDocumentModel()

setDocumentModel

public void setDocumentModel(DocumentModel documentModel)

getNodeValue

public java.lang.Object getNodeValue()

setNodeValue

public void setNodeValue(java.lang.Object nodeValue)

getDefaultNodeValue

public java.lang.Object getDefaultNodeValue()

isCollectionNode

public boolean isCollectionNode()

getLocalPaths

public java.util.List getLocalPaths()

setLocalPaths

protected void setLocalPaths(java.util.List localPaths)

getLocalPathMap

public java.util.Map getLocalPathMap()

createLocalPaths

protected abstract java.util.List createLocalPaths()
Returns an Unmodifiable List of paths to local children values.


isDependent

public abstract boolean isDependent()

isDeleted

public boolean isDeleted()

markDeleted

public void markDeleted()

setIsDeleted

public void setIsDeleted(boolean isDeleted)

getValueAt

public java.lang.Object getValueAt(java.lang.String path)

getValueAt

public java.lang.Object getValueAt(java.lang.String path,
                                   boolean returnDefaultOnNull)

getValueAtLocal

protected final java.lang.Object getValueAtLocal(java.lang.String path)

getValueAtLocalInternal

protected abstract java.lang.Object getValueAtLocalInternal(java.lang.String path)
Should be overriden by subclass


getDefaultValueAtLocal

public java.lang.Object getDefaultValueAtLocal(java.lang.String path)

getMetaDataAt

public java.lang.Object getMetaDataAt(java.lang.String path,
                                      java.lang.String identifier)
Returns the Class for the position specified by the given path. Returns null if the end position in the path cannot be reached. Returns the declared type of the parent value for that field if the value is null.


getMetaDataAtLocal

protected final java.lang.Object getMetaDataAtLocal(java.lang.String path,
                                                    java.lang.String identifier,
                                                    boolean delegatedByChildCollection)

getMetaDataAtLocalInternal

protected abstract java.lang.Object getMetaDataAtLocalInternal(java.lang.String path,
                                                               java.lang.String identifier,
                                                               boolean delegatedByChildCollection)
Should be overriden by subclass


setValueAt

public java.lang.Object setValueAt(java.lang.String path,
                                   java.lang.Object value)

setValueAtLocal

protected final java.lang.Object setValueAtLocal(java.lang.String path,
                                                 java.lang.Object value)

makeCoercedValue

protected java.lang.Object makeCoercedValue(java.lang.String path,
                                            java.lang.Object value)

setValueAtLocalInternal

protected abstract java.lang.Object setValueAtLocalInternal(java.lang.String path,
                                                            java.lang.Object value)
Should be overriden by subclass


applyPathMap

public void applyPathMap(java.util.Map pathMap)

getPathMap

public java.util.Map getPathMap(int depth,
                                boolean dependentsInclusive)

getPathMap

public java.util.Map getPathMap(int depth,
                                boolean dependentsInclusive,
                                boolean leavesOnly,
                                java.lang.String matches)
A depth of 1 returns localChildren paths and thier values only only. Note this is consistent with all depth usages, depth denotes the number of edges to traverse. a depth of 0 traverses no edges. With leavesOnly true, only the available leaf values are returned in the map. By setting both dependentsInclusive and leavesOnly to true, a full compliment of literal/primitive values will be returned that compose the existing docuement. Note that a path that results in null will be added to the map so that the value of null may be changed. Also note that a Map returned from this method is not guaranteed to be successful in an apply. There may be accessors for a field, but not setters.


getPathMap

public java.util.Map getPathMap(int depth,
                                boolean dependentsInclusive,
                                boolean leavesOnly)

makePath

protected java.lang.String makePath(java.lang.String pathRoot,
                                    java.lang.String currentPath)

createLocalPathMap

public java.util.Map createLocalPathMap()

getDeclaredFieldType

protected java.lang.Class getDeclaredFieldType(java.lang.String path)

hasNodeListeners

public boolean hasNodeListeners()

getNodeListeners

public java.util.List getNodeListeners()

hasNodeListener

public boolean hasNodeListener(NodeListener nodeListener)

addNodeListener

public void addNodeListener(NodeListener nodeListener)

removeNodeListener

public void removeNodeListener(NodeListener nodeListener)


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.