Package com.bc.ceres.binding.dom
Class DefaultDomElement
- java.lang.Object
-
- com.bc.ceres.binding.dom.DefaultDomElement
-
- All Implemented Interfaces:
DomElement,ConfigurationElementBase<DomElement>
public class DefaultDomElement extends Object implements DomElement
-
-
Constructor Summary
Constructors Constructor Description DefaultDomElement(String name)DefaultDomElement(String name, String value)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChild(DomElement child)DomElementcreateChild(String name)StringgetAttribute(String name)Gets the value of the attribute with the specified name.String[]getAttributeNames()Gets the names of all attributes.DomElementgetChild(int index)DomElementgetChild(String elementName)Gets the child element with the specified element name.intgetChildCount()DomElement[]getChildren()Gets all children.DomElement[]getChildren(String elementName)Gets all children with the specified element name.StringgetName()Gets the name of this element.DomElementgetParent()Gets the element which contains this element.StringgetValue()Gets the value of this element.voidsetAttribute(String name, String value)voidsetParent(DomElement parent)voidsetValue(String value)StringtoXml()
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ConfigurationElementBaseGets the name of this element.- Specified by:
getNamein interfaceConfigurationElementBase<DomElement>- Returns:
- The name of this element.
-
getValue
public String getValue()
Description copied from interface:ConfigurationElementBaseGets the value of this element.- Specified by:
getValuein interfaceConfigurationElementBase<DomElement>- Returns:
- The value of this element, or
null.
-
setValue
public void setValue(String value)
- Specified by:
setValuein interfaceDomElement
-
getParent
public DomElement getParent()
Description copied from interface:ConfigurationElementBaseGets the element which contains this element. If this element is an immediate child of an extension or an extension point, the returned value isnull.- Specified by:
getParentin interfaceConfigurationElementBase<DomElement>- Returns:
- The parent of this configuration element or
nullif this is a root element.
-
setParent
public void setParent(DomElement parent)
- Specified by:
setParentin interfaceDomElement
-
getAttribute
public String getAttribute(String name)
Description copied from interface:ConfigurationElementBaseGets the value of the attribute with the specified name.- Specified by:
getAttributein interfaceConfigurationElementBase<DomElement>- Parameters:
name- The attribute name.- Returns:
- The value of the attribute, or
null.
-
setAttribute
public void setAttribute(String name, String value)
- Specified by:
setAttributein interfaceDomElement
-
getAttributeNames
public String[] getAttributeNames()
Description copied from interface:ConfigurationElementBaseGets the names of all attributes.- Specified by:
getAttributeNamesin interfaceConfigurationElementBase<DomElement>- Returns:
- The array of names, which may be empty.
-
getChild
public DomElement getChild(String elementName)
Description copied from interface:ConfigurationElementBaseGets the child element with the specified element name.- Specified by:
getChildin interfaceConfigurationElementBase<DomElement>- Parameters:
elementName- The element name.- Returns:
- The child element or
nullif no such could be found.
-
getChildren
public DomElement[] getChildren()
Description copied from interface:ConfigurationElementBaseGets all children.- Specified by:
getChildrenin interfaceConfigurationElementBase<DomElement>- Returns:
- The array of children, which may be empty.
-
getChildren
public DomElement[] getChildren(String elementName)
Description copied from interface:ConfigurationElementBaseGets all children with the specified element name.- Specified by:
getChildrenin interfaceConfigurationElementBase<DomElement>- Parameters:
elementName- The element name.- Returns:
- The array of children, which may be empty.
-
getChild
public DomElement getChild(int index)
- Specified by:
getChildin interfaceDomElement
-
getChildCount
public int getChildCount()
- Specified by:
getChildCountin interfaceDomElement
-
createChild
public DomElement createChild(String name)
- Specified by:
createChildin interfaceDomElement
-
addChild
public void addChild(DomElement child)
- Specified by:
addChildin interfaceDomElement
-
toXml
public String toXml()
- Specified by:
toXmlin interfaceDomElement
-
-