net.sourceforge.nite.nxt
Class NOMObjectModelElement

java.lang.Object
  extended by net.sourceforge.nite.nxt.NOMObjectModelElement
All Implemented Interfaces:
ObjectModelElement

public class NOMObjectModelElement
extends java.lang.Object
implements ObjectModelElement

This is a wrapper for NOMElement so that it implements the ObjectModelElement interface

Author:
jonathan

Constructor Summary
NOMObjectModelElement(NOMElement element)
          Constructor JDomObjectModelElement.
 
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 c)
          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.lang.String getAttribute(java.lang.String aname)
           
 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 name)
          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
 NOMElement getElement()
          Returns the 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 displayedAttribute)
          Sets the displayedAttribute.
 void setElement(NOMElement element)
          Sets the element.
 void setNamespace(java.lang.String string)
          Method setNamespace.
 void setParent(ObjectModelElement e)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NOMObjectModelElement

public NOMObjectModelElement(NOMElement element)
Constructor JDomObjectModelElement.

Parameters:
element -
Method Detail

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Description copied from interface: ObjectModelElement
Replace the specified attribute of this element with the specified element Or create the specified attribute if it did not previously exist

Specified by:
addAttribute in interface ObjectModelElement
See Also:
ObjectModelElement.addAttribute(String, String)

deleteElement

public void deleteElement()
Description copied from interface: ObjectModelElement
Delete this element

Specified by:
deleteElement in interface ObjectModelElement

addContent

public void addContent(java.lang.String c)
Description copied from interface: ObjectModelElement
Replace the current textual content with the specified textual content

Specified by:
addContent in interface ObjectModelElement

getTextualContent

public java.lang.String getTextualContent()
Description copied from interface: ObjectModelElement
Returns the textual content of this element

Specified by:
getTextualContent in interface ObjectModelElement
Returns:
String

getAttribute

public java.lang.String getAttribute(java.lang.String aname)

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String name)
Description copied from interface: ObjectModelElement
Returns the value of the specified attribute

Specified by:
getAttributeValue in interface ObjectModelElement
See Also:
net.sourceforge.nite.nxt.ObjectModelElement#getAttributeValue()

getDisplayedAttribute

public java.lang.String getDisplayedAttribute()
Description copied from interface: ObjectModelElement
Returns the name of the attribute which is displayed on-screen by this object model element

Specified by:
getDisplayedAttribute in interface ObjectModelElement
See Also:
ObjectModelElement.getDisplayedAttribute()

setDisplayedAttribute

public void setDisplayedAttribute(java.lang.String displayedAttribute)
Sets the displayedAttribute.

Specified by:
setDisplayedAttribute in interface ObjectModelElement
Parameters:
displayedAttribute - The displayedAttribute to set

getID

public java.lang.String getID()
Description copied from interface: ObjectModelElement
Returns the unique ID of this element

Specified by:
getID in interface ObjectModelElement
See Also:
ObjectModelElement.getID()

getElement

public NOMElement getElement()
Returns the element.

Returns:
NOMElement

setElement

public void setElement(NOMElement element)
Sets the element.

Parameters:
element - The element to set

removeChild

public void removeChild(ObjectModelElement e)
Description copied from interface: ObjectModelElement
Remove the specified child from this element

Specified by:
removeChild in interface ObjectModelElement
See Also:
ObjectModelElement.removeChild(net.sourceforge.nite.nxt.ObjectModelElement)

makeElement

public ObjectModelElement makeElement()
Description copied from interface: ObjectModelElement
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

Specified by:
makeElement in interface ObjectModelElement
See Also:
ObjectModelElement.makeElement()

addPointer

public void addPointer(java.lang.String role,
                       ObjectModelElement el)
Specified by:
addPointer in interface ObjectModelElement

removePointer

public void removePointer(java.lang.String role,
                          ObjectModelElement e)
Specified by:
removePointer in interface ObjectModelElement
See Also:
ObjectModelElement.removePointer(java.lang.String, net.sourceforge.nite.nxt.ObjectModelElement)

addChild

public void addChild(ObjectModelElement e,
                     int pos)
Description copied from interface: ObjectModelElement
Add the specified child element to this at the specified position in the child list

Specified by:
addChild in interface ObjectModelElement
See Also:
net.sourceforge.nite.nxt.ObjectModelElement#addChild(net.sourceforge.nite.nxt.ObjectModelElement)

getParent

public ObjectModelElement getParent()
Specified by:
getParent in interface ObjectModelElement
See Also:
ObjectModelElement.getParent()

setParent

public void setParent(ObjectModelElement e)
Specified by:
setParent in interface ObjectModelElement
See Also:
ObjectModelElement.setParent(net.sourceforge.nite.nxt.ObjectModelElement)

getChildIndex

public int getChildIndex()
Description copied from interface: ObjectModelElement
Returns the index of this element into its parent's child list.

Specified by:
getChildIndex in interface ObjectModelElement
Returns:
int
See Also:
ObjectModelElement.getChildIndex()

setChildIndex

public void setChildIndex(int i)
Description copied from interface: ObjectModelElement
Sets the index of this element into its parent's children list

Specified by:
setChildIndex in interface ObjectModelElement
See Also:
ObjectModelElement.setChildIndex(int)

getAttributes

public java.util.List getAttributes()
Description copied from interface: ObjectModelElement
Returns list of string, string tuples representing the attributes and values of this element

Specified by:
getAttributes in interface ObjectModelElement
Returns:
List
See Also:
net.sourceforge.nite.nxt.ObjectModelElement#getAttributeValuePairs()

getName

public java.lang.String getName()
Description copied from interface: ObjectModelElement
Method getName. Returns the name of the element

Specified by:
getName in interface ObjectModelElement
Returns:
String
See Also:
ObjectModelElement.getName()

getNamespace

public java.lang.String getNamespace()
Description copied from interface: ObjectModelElement
Returns the namespace which this element is in

Specified by:
getNamespace in interface ObjectModelElement
Returns:
String
See Also:
ObjectModelElement.getNamespace()

setNamespace

public void setNamespace(java.lang.String string)
Method setNamespace.

Specified by:
setNamespace in interface ObjectModelElement
Parameters:
string -

addSibling

public void addSibling(ObjectModelElement e,
                       int pos)
Specified by:
addSibling in interface ObjectModelElement
See Also:
ObjectModelElement.addSibling(net.sourceforge.nite.nxt.ObjectModelElement, int)

getChildren

public java.util.List getChildren()
Description copied from interface: ObjectModelElement
Returns the children of this element as a list of ObjectModelElements

Specified by:
getChildren in interface ObjectModelElement
Returns:
List
See Also:
ObjectModelElement.getChildren()

copy

public ObjectModelElement copy()
Description copied from interface: ObjectModelElement
Returns a new objectmodelelement which is a copy of this one

Specified by:
copy in interface ObjectModelElement
Returns: