net.xoetrope.xml.jaxp
Class JaxpXmlElement

java.lang.Object
  extended by net.xoetrope.xml.jaxp.JaxpXmlElement
All Implemented Interfaces:
XmlElement

public class JaxpXmlElement
extends java.lang.Object
implements XmlElement

A customization of the XmlElement to interface with Xerces

Copyright (c) Xoetrope Ltd., 1998-2003
License: see license.txt


Field Summary
protected  java.util.Vector children
          Vector containing children of the implementing Object
protected  org.w3c.dom.Element element
          The implementing object
 
Constructor Summary
JaxpXmlElement()
          Create the implementing object
JaxpXmlElement(org.w3c.dom.Element e)
          ctor which passes the implementing object as a parameter
JaxpXmlElement(java.lang.String name)
          Not implemented
 
Method Summary
 void addChild(XmlElement child)
          Add the passed child to the implementing object
 XmlElement createElement(java.lang.String name)
          Create a basic XmlElement of the type registered in the XmlParserFactory
 XmlElement elementAt(int i)
          Retrieve the XmlElement at the requested position of the implementing object
 java.util.Enumeration enumerateAttributeNames()
          Retrieve and Enumeration of the implementing object's attributes
 java.lang.String getAttribute(java.lang.String name)
          Retrieve the named attribute of the implementing XmlElement
 int getAttributeCount()
          Retrieve a count of the implementing classes attributes
 java.lang.String getAttributeNamespace(java.lang.String name)
          Retrieve the namespace of the named attribute of the implementation object
 java.util.Vector getChildren()
          Retrieve a Vector of child XmlElements contained in the implementing object
 java.util.Vector getChildren(java.lang.String path)
          Retrieve a Vector of child XmlElements contained in the implementing object at the path specified by the path parameter
 java.lang.String getContent()
          Retrieve the content of the implementing XmlElement
 org.w3c.dom.Element getElement()
          Retrive the implementing XmlElement object
 XmlElement getFirstChildNamed(java.lang.String name)
          Retrieve the first XmlElement found at the path specified by the name parameter of the implementing XmlElement
 java.lang.Object getImplementation()
          Retrieve the XmlElement implementation object
 java.lang.String getName()
          Retrieve the name of the implementing XmlElement object
 java.lang.String getNamespace()
          Retrieve the namespace of the implementation object
 void setAttribute(java.lang.String name, java.lang.String value)
          Set the value of the named attribute in the implementing XmlElement object
 void setName(java.lang.String newName)
          Set the name of the implementing XmlElement object
 java.lang.String toString()
          The overloaded toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

element

protected org.w3c.dom.Element element
The implementing object


children

protected java.util.Vector children
Vector containing children of the implementing Object

Constructor Detail

JaxpXmlElement

public JaxpXmlElement()
Create the implementing object


JaxpXmlElement

public JaxpXmlElement(org.w3c.dom.Element e)
ctor which passes the implementing object as a parameter

Parameters:
e - The instance of the Element which is to be used as the implementing object

JaxpXmlElement

public JaxpXmlElement(java.lang.String name)
Not implemented

Parameters:
name - The name of the implementing object
Method Detail

elementAt

public XmlElement elementAt(int i)
Retrieve the XmlElement at the requested position of the implementing object

Specified by:
elementAt in interface XmlElement
Parameters:
i - The index of the XmlElement required
Returns:
The XmlElement at the specified index

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Retrieve the named attribute of the implementing XmlElement

Specified by:
getAttribute in interface XmlElement
Parameters:
name - The name of the attribute to be retrieved
Returns:
The value of the attribute

getChildren

public java.util.Vector getChildren()
Retrieve a Vector of child XmlElements contained in the implementing object

Specified by:
getChildren in interface XmlElement
Returns:
A Vector of child XmlElements

getChildren

public java.util.Vector getChildren(java.lang.String path)
Retrieve a Vector of child XmlElements contained in the implementing object at the path specified by the path parameter

Specified by:
getChildren in interface XmlElement
Parameters:
path - The path into the implementing object from which the return Vector is to be made up
Returns:
A Vector of child XmlElements

getName

public java.lang.String getName()
Retrieve the name of the implementing XmlElement object

Specified by:
getName in interface XmlElement
Returns:
The name of the implementing object

setName

public void setName(java.lang.String newName)
Set the name of the implementing XmlElement object

Specified by:
setName in interface XmlElement
Parameters:
newName - The name to be applied to the implementing XmlElement object

getContent

public java.lang.String getContent()
Retrieve the content of the implementing XmlElement

Specified by:
getContent in interface XmlElement
Returns:
The implementing object's content

enumerateAttributeNames

public java.util.Enumeration enumerateAttributeNames()
Retrieve and Enumeration of the implementing object's attributes

Specified by:
enumerateAttributeNames in interface XmlElement
Returns:
An Enumeration of the implementing object's attribute names

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Set the value of the named attribute in the implementing XmlElement object

Specified by:
setAttribute in interface XmlElement
Parameters:
name - The name of the attribute to be set
value - The new value of the attribute

addChild

public void addChild(XmlElement child)
Add the passed child to the implementing object

Specified by:
addChild in interface XmlElement
Parameters:
child - The XmlElement to be added to the implementing object

createElement

public XmlElement createElement(java.lang.String name)
Create a basic XmlElement of the type registered in the XmlParserFactory

Specified by:
createElement in interface XmlElement
Parameters:
name - The name of the new element
Returns:
The created XmlElement

getFirstChildNamed

public XmlElement getFirstChildNamed(java.lang.String name)
Retrieve the first XmlElement found at the path specified by the name parameter of the implementing XmlElement

Specified by:
getFirstChildNamed in interface XmlElement
Parameters:
name - The path to the element of the implementing XmlElement object's to be found
Returns:
The first instance of an XmlElement found at the specified path of the implementing object

getNamespace

public java.lang.String getNamespace()
Retrieve the namespace of the implementation object

Specified by:
getNamespace in interface XmlElement
Returns:
The implementation objects namespace

getAttributeCount

public int getAttributeCount()
Retrieve a count of the implementing classes attributes

Specified by:
getAttributeCount in interface XmlElement
Returns:
The amount of attributes contained in the implementing object

getAttributeNamespace

public java.lang.String getAttributeNamespace(java.lang.String name)
Retrieve the namespace of the named attribute of the implementation object

Specified by:
getAttributeNamespace in interface XmlElement
Parameters:
name - The name of the attributes namespace
Returns:
The name of the named attribute namespace

getImplementation

public java.lang.Object getImplementation()
Retrieve the XmlElement implementation object

Specified by:
getImplementation in interface XmlElement
Returns:
The XmlElement object

getElement

public org.w3c.dom.Element getElement()
Retrive the implementing XmlElement object

Returns:
the implementing XmlElement object

toString

public java.lang.String toString()
The overloaded toString method

Overrides:
toString in class java.lang.Object
Returns:
The XML text of the implementing XmlElement object and its children