net.xoetrope.xml
Interface XmlElement

All Known Implementing Classes:
JaxpXmlElement, NanoXmlElement

public interface XmlElement

An interface describing the methods needed for simple interaction with XML data

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


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
 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 name)
          Set the name of the implementing XmlElement object
 

Method Detail

getImplementation

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

Returns:
The XmlElement object

getNamespace

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

Returns:
The implementation objects namespace

getAttributeNamespace

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

Parameters:
name - The name of the attributes namespace
Returns:
The name of the named attribute namespace

elementAt

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

Parameters:
i - The index of the XmlElement required
Returns:
The XmlElement at the specified index

createElement

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

Parameters:
name - The name of the new element
Returns:
The created XmlElement

addChild

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

Parameters:
child - The XmlElement to be added to the implementing object

getChildren

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

Returns:
A Vector of child XmlElements

getChildren

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

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

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

Returns:
The name of the implementing object

setName

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

Parameters:
name - The name to be applied to the implementing XmlElement object

getFirstChildNamed

XmlElement getFirstChildNamed(java.lang.String name)
Retrieve the first XmlElement found at the path specified by the name parameter of the implementing 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

getContent

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

Returns:
The implementing object's content

getAttribute

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

Parameters:
name - The name of the attribute to be retrieved
Returns:
The value of the attribute

setAttribute

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

Parameters:
name - The name of the attribute to be set
value - The new value of the attribute

enumerateAttributeNames

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

Returns:
An Enumeration of the implementing object's attribute names

getAttributeCount

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

Returns:
The amount of attributes contained in the implementing object