uk.ac.ic.doc.automed.p2p.tree
Class TreeNode
java.lang.Object
uk.ac.ic.doc.automed.p2p.tree.TreeNode
- Direct Known Subclasses:
- AutoMedObject, CollectionSet, Field, MainObjectClasses, ObjectCollection, Root, Value
public abstract class TreeNode
- extends java.lang.Object
- Author:
- Charis
TODO To change the template for this generated type comment go to
Window - Preferences - Java - Code Style - Code Templates
Constructor Summary |
TreeNode(java.lang.Object id)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
OBJECT_DEFINITION
public static final java.lang.String OBJECT_DEFINITION
- See Also:
- Constant Field Values
COLLECTION_SET
public static final java.lang.String COLLECTION_SET
- See Also:
- Constant Field Values
MAIN_OBJECT_CLASSES
public static final java.lang.String MAIN_OBJECT_CLASSES
- See Also:
- Constant Field Values
COLLECTION
public static final java.lang.String COLLECTION
- See Also:
- Constant Field Values
LIST
public static final java.lang.String LIST
- See Also:
- Constant Field Values
OBJECT
public static final java.lang.String OBJECT
- See Also:
- Constant Field Values
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
FIELD
public static final java.lang.String FIELD
- See Also:
- Constant Field Values
CLASS
public static final java.lang.String CLASS
- See Also:
- Constant Field Values
GLOBAL
public static final java.lang.String GLOBAL
- See Also:
- Constant Field Values
REF
public static final java.lang.String REF
- See Also:
- Constant Field Values
VALUE
public static final java.lang.String VALUE
- See Also:
- Constant Field Values
OBJECT_LIST
public static final java.lang.String OBJECT_LIST
- See Also:
- Constant Field Values
children
protected java.util.Map children
id
protected java.lang.Object id
parent
protected TreeNode parent
TreeNode
public TreeNode(java.lang.Object id)
getChildren
public java.util.List getChildren()
getId
public java.lang.Object getId()
setId
protected void setId(java.lang.String id)
setParent
protected void setParent(TreeNode parent)
addChild
public void addChild(TreeNode child)
throws AutoMedTreeException
- Throws:
AutoMedTreeException
placeChild
protected void placeChild(TreeNode child)
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
getChild
public TreeNode getChild(java.lang.Object id)
createObjectNode
protected static AutoMedObject createObjectNode(PersistentObject po)
throws AutoMedTreeException
- Throws:
AutoMedTreeException
createTree
public static Root createTree(PersistentObject po)
throws AutoMedTreeException
- Throws:
AutoMedTreeException
createTree
public static Root createTree(PersistentObject[] persistentObjects)
throws AutoMedTreeException
- Throws:
AutoMedTreeException
getValueNode
private static Value getValueNode(java.lang.Object value)
throws AutoMedTreeException
- Throws:
AutoMedTreeException
isValidChild
protected abstract boolean isValidChild(TreeNode child)
getXMLNode
protected abstract org.w3c.dom.Node getXMLNode(org.w3c.dom.Document document)
getXMLDocument
public org.w3c.dom.Document getXMLDocument()
- Build a simple XML document for this node. This is useful
in cases where we are only interested in XML representation of only a part (e.g. ObjectCollection)
of a XML document tree
getXMLString
public java.lang.String getXMLString()
- Similar to
getXMLDocument()
but returns the XML string of the document