org.apache.dvsl.dom4j
Class Dom4jNodeImpl

java.lang.Object
  extended by org.apache.dvsl.dom4j.Dom4jNodeImpl
All Implemented Interfaces:
DVSLNode

public class Dom4jNodeImpl
extends Object
implements DVSLNode

wrapper class for dom4j nodes to implement the DVSLNode interface for template use

Author:
Geir Magnusson Jr.

Field Summary
protected  Map attributes
           
protected  org.dom4j.Node element
           
 
Constructor Summary
Dom4jNodeImpl(org.dom4j.Attribute e)
           
Dom4jNodeImpl(org.dom4j.CDATA e)
           
Dom4jNodeImpl(org.dom4j.Comment e)
           
Dom4jNodeImpl(org.dom4j.Document e)
           
Dom4jNodeImpl(org.dom4j.Element e)
          this is a bit yecchy - need to revamp
Dom4jNodeImpl(org.dom4j.Text e)
           
 
Method Summary
 String attrib(String name)
          returns attribute
 String attribute(String attribute)
          returns a specificed attributeattribute
 List children()
          returns a list of all children of the current node
 String copy()
          renders a deep copy of the XML tree below the current node to the output
 String copy(List nodes)
          assumes a list of DVSLNodes
 DVSLNode get(String xpath)
           
 Map getAttribMap()
           
 Object getNodeImpl()
          returns the object corresponding to the node in the implementaion that we are using.
 String name()
          returns the name of the node
 String render()
           
 List selectNodes(String xpath)
          returns a list of nodes that satisfy the xpath
 DVSLNode selectSingleNode(String xpath)
          returns a single node that satisfies the xpath
 String toString()
          returns the 'value' of the node
 String value()
          returns the 'value' of the node
 Object valueOf(String xpath)
          returns the value of the XPAth expression
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected org.dom4j.Node element

attributes

protected Map attributes
Constructor Detail

Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.Element e)
this is a bit yecchy - need to revamp


Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.Document e)

Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.Text e)

Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.Attribute e)

Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.Comment e)

Dom4jNodeImpl

public Dom4jNodeImpl(org.dom4j.CDATA e)
Method Detail

name

public String name()
returns the name of the node

Specified by:
name in interface DVSLNode

attribute

public String attribute(String attribute)
returns a specificed attributeattribute


selectNodes

public List selectNodes(String xpath)
returns a list of nodes that satisfy the xpath

Specified by:
selectNodes in interface DVSLNode

selectSingleNode

public DVSLNode selectSingleNode(String xpath)
Description copied from interface: DVSLNode
returns a single node that satisfies the xpath

Specified by:
selectSingleNode in interface DVSLNode

get

public DVSLNode get(String xpath)
Specified by:
get in interface DVSLNode

value

public String value()
Description copied from interface: DVSLNode
returns the 'value' of the node

Specified by:
value in interface DVSLNode

valueOf

public Object valueOf(String xpath)
Description copied from interface: DVSLNode
returns the value of the XPAth expression

Specified by:
valueOf in interface DVSLNode

toString

public String toString()
Description copied from interface: DVSLNode
returns the 'value' of the node

Specified by:
toString in interface DVSLNode
Overrides:
toString in class Object

children

public List children()
Description copied from interface: DVSLNode
returns a list of all children of the current node

Specified by:
children in interface DVSLNode

copy

public String copy(List nodes)
assumes a list of DVSLNodes

Specified by:
copy in interface DVSLNode

copy

public String copy()
Description copied from interface: DVSLNode
renders a deep copy of the XML tree below the current node to the output

Specified by:
copy in interface DVSLNode

render

public String render()

attrib

public String attrib(String name)
Description copied from interface: DVSLNode
returns attribute

Specified by:
attrib in interface DVSLNode

getNodeImpl

public Object getNodeImpl()
Description copied from interface: DVSLNode
returns the object corresponding to the node in the implementaion that we are using. use only with the greatest of care

Specified by:
getNodeImpl in interface DVSLNode

getAttribMap

public Map getAttribMap()
Specified by:
getAttribMap in interface DVSLNode


Copyright © 2002-2007 The Apache Software Foundation. All Rights Reserved.