net.sourceforge.nite.nxt
Interface ObjectModelElement

All Known Implementing Classes:
JDomObjectModelElement, NOMObjectModelElement

public interface ObjectModelElement

This is a wrapper for NOM and JDOM elements so that NXT can use either of these object models. Jonathan, you might want to change this or put it in a different package at some point

Author:
judyr

Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Replace the specified attribute of this element with the specified element Or create the specified attribute if it did not previously exist
 void addChild(ObjectModelElement e, int pos)
          Add the specified child element to this at the specified position in the child list
 void addContent(java.lang.String content)
          Replace the current textual content with the specified textual content
 void addPointer(java.lang.String role, ObjectModelElement el)
           
 void addSibling(ObjectModelElement e, int pos)
           
 ObjectModelElement copy()
          Returns a new objectmodelelement which is a copy of this one
 void deleteElement()
          Delete this element
 java.util.List getAttributes()
          Returns list of string, string tuples representing the attributes and values of this element
 java.lang.String getAttributeValue(java.lang.String s)
          Returns the value of the specified attribute
 int getChildIndex()
          Returns the index of this element into its parent's child list.
 java.util.List getChildren()
          Returns the children of this element as a list of ObjectModelElements
 java.lang.String getDisplayedAttribute()
          Returns the name of the attribute which is displayed on-screen by this object model element
 java.lang.String getID()
          Returns the unique ID of this element
 java.lang.String getName()
          Method getName.
 java.lang.String getNamespace()
          Returns the namespace which this element is in
 ObjectModelElement getParent()
           
 java.lang.String getTextualContent()
          Returns the textual content of this element
 ObjectModelElement makeElement()
          Returns a new (empty) object model element.
 void removeChild(ObjectModelElement e)
          Remove the specified child from this element
 void removePointer(java.lang.String role, ObjectModelElement e)
           
 void setChildIndex(int i)
          Sets the index of this element into its parent's children list
 void setDisplayedAttribute(java.lang.String a)
          Keeps a record of which attribute this object displays on-screen
 void setNamespace(java.lang.String namespace)
           
 void setParent(ObjectModelElement e)
           
 

Method Detail

getID

java.lang.String getID()
Returns the unique ID of this element


addAttribute

void addAttribute(java.lang.String name,
                  java.lang.String value)
Replace the specified attribute of this element with the specified element Or create the specified attribute if it did not previously exist


addContent

void addContent(java.lang.String content)
Replace the current textual content with the specified textual content


removeChild

void removeChild(ObjectModelElement e)
Remove the specified child from this element


deleteElement

void deleteElement()
Delete this element


makeElement

ObjectModelElement makeElement()
Returns a new (empty) object model element. FIX ME: I reckon we need to rethink this. Factory classes might sort this problem out, and also address the problem of allowing full access to the NOM through this interface


addPointer

void addPointer(java.lang.String role,
                ObjectModelElement el)

removePointer

void removePointer(java.lang.String role,
                   ObjectModelElement e)

getTextualContent

java.lang.String getTextualContent()
Returns the textual content of this element

Returns:
String

getAttributeValue

java.lang.String getAttributeValue(java.lang.String s)
Returns the value of the specified attribute


getDisplayedAttribute

java.lang.String getDisplayedAttribute()
Returns the name of the attribute which is displayed on-screen by this object model element


setDisplayedAttribute

void setDisplayedAttribute(java.lang.String a)
Keeps a record of which attribute this object displays on-screen

Parameters:
a -

addChild

void addChild(ObjectModelElement e,
              int pos)
Add the specified child element to this at the specified position in the child list


addSibling

void addSibling(ObjectModelElement e,
                int pos)

getParent

ObjectModelElement getParent()

setParent

void setParent(ObjectModelElement e)

getChildren

java.util.List getChildren()
Returns the children of this element as a list of ObjectModelElements

Returns:
List

getChildIndex

int getChildIndex()
Returns the index of this element into its parent's child list.

Returns:
int

setChildIndex

void setChildIndex(int i)
Sets the index of this element into its parent's children list

Parameters:
i -

getAttributes

java.util.List getAttributes()
Returns list of string, string tuples representing the attributes and values of this element

Returns:
List

getName

java.lang.String getName()
Method getName. Returns the name of the element

Returns:
String

getNamespace

java.lang.String getNamespace()
Returns the namespace which this element is in

Returns:
String

setNamespace

void setNamespace(java.lang.String namespace)

copy

ObjectModelElement copy()
Returns a new objectmodelelement which is a copy of this one

Returns: