Class Dom4jNodeImpl

  • All Implemented Interfaces:
    DVSLNode

    public class Dom4jNodeImpl
    extends java.lang.Object
    implements DVSLNode
    wrapper class for dom4j nodes to implement the DVSLNode interface for template use
    Author:
    Geir Magnusson Jr.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map attributes  
      protected org.dom4j.Node element  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String attrib​(java.lang.String name)
      returns attribute
      java.lang.String attribute​(java.lang.String attribute)
      returns a specificed attributeattribute
      java.util.List children()
      returns a list of all children of the current node
      java.lang.String copy()
      renders a deep copy of the XML tree below the current node to the output
      java.lang.String copy​(java.util.List nodes)
      assumes a list of DVSLNodes
      private void copy​(org.dom4j.Node node, java.io.Writer writer)  
      DVSLNode get​(java.lang.String xpath)  
      java.util.Map getAttribMap()  
      java.lang.Object getNodeImpl()
      returns the object corresponding to the node in the implementaion that we are using.
      private DVSLNode makeDVSLNode​(org.dom4j.Node n)
      will recast all of this later
      java.lang.String name()
      returns the name of the node
      java.lang.String render()  
      java.util.List selectNodes​(java.lang.String xpath)
      returns a list of nodes that satisfy the xpath
      DVSLNode selectSingleNode​(java.lang.String xpath)
      returns a single node that satisfies the xpath
      java.lang.String toString()
      returns the 'value' of the node
      java.lang.String value()
      returns the 'value' of the node
      java.lang.Object valueOf​(java.lang.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 java.util.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)
      • Dom4jNodeImpl

        private Dom4jNodeImpl()
    • Method Detail

      • name

        public java.lang.String name()
        returns the name of the node
        Specified by:
        name in interface DVSLNode
      • attribute

        public java.lang.String attribute​(java.lang.String attribute)
        returns a specificed attributeattribute
      • selectNodes

        public java.util.List selectNodes​(java.lang.String xpath)
        returns a list of nodes that satisfy the xpath
        Specified by:
        selectNodes in interface DVSLNode
      • selectSingleNode

        public DVSLNode selectSingleNode​(java.lang.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​(java.lang.String xpath)
        Specified by:
        get in interface DVSLNode
      • value

        public java.lang.String value()
        Description copied from interface: DVSLNode
        returns the 'value' of the node
        Specified by:
        value in interface DVSLNode
      • valueOf

        public java.lang.Object valueOf​(java.lang.String xpath)
        Description copied from interface: DVSLNode
        returns the value of the XPAth expression
        Specified by:
        valueOf in interface DVSLNode
      • toString

        public java.lang.String toString()
        Description copied from interface: DVSLNode
        returns the 'value' of the node
        Specified by:
        toString in interface DVSLNode
        Overrides:
        toString in class java.lang.Object
      • children

        public java.util.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 java.lang.String copy​(java.util.List nodes)
        assumes a list of DVSLNodes
        Specified by:
        copy in interface DVSLNode
      • copy

        public java.lang.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
      • copy

        private void copy​(org.dom4j.Node node,
                          java.io.Writer writer)
      • render

        public java.lang.String render()
      • attrib

        public java.lang.String attrib​(java.lang.String name)
        Description copied from interface: DVSLNode
        returns attribute
        Specified by:
        attrib in interface DVSLNode
      • getNodeImpl

        public java.lang.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 java.util.Map getAttribMap()
        Specified by:
        getAttribMap in interface DVSLNode
      • makeDVSLNode

        private DVSLNode makeDVSLNode​(org.dom4j.Node n)
        will recast all of this later