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 void
addChild(DomElement child)
DomElement
createChild(String name)
String
getAttribute(String name)
Gets the value of the attribute with the specified name.String[]
getAttributeNames()
Gets the names of all attributes.DomElement
getChild(int index)
DomElement
getChild(String elementName)
Gets the child element with the specified element name.int
getChildCount()
DomElement[]
getChildren()
Gets all children.DomElement[]
getChildren(String elementName)
Gets all children with the specified element name.String
getName()
Gets the name of this element.DomElement
getParent()
Gets the element which contains this element.String
getValue()
Gets the value of this element.void
setAttribute(String name, String value)
void
setParent(DomElement parent)
void
setValue(String value)
String
toXml()
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:ConfigurationElementBase
Gets the name of this element.- Specified by:
getName
in interfaceConfigurationElementBase<DomElement>
- Returns:
- The name of this element.
-
getValue
public String getValue()
Description copied from interface:ConfigurationElementBase
Gets the value of this element.- Specified by:
getValue
in interfaceConfigurationElementBase<DomElement>
- Returns:
- The value of this element, or
null
.
-
setValue
public void setValue(String value)
- Specified by:
setValue
in interfaceDomElement
-
getParent
public DomElement getParent()
Description copied from interface:ConfigurationElementBase
Gets 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:
getParent
in interfaceConfigurationElementBase<DomElement>
- Returns:
- The parent of this configuration element or
null
if this is a root element.
-
setParent
public void setParent(DomElement parent)
- Specified by:
setParent
in interfaceDomElement
-
getAttribute
public String getAttribute(String name)
Description copied from interface:ConfigurationElementBase
Gets the value of the attribute with the specified name.- Specified by:
getAttribute
in 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:
setAttribute
in interfaceDomElement
-
getAttributeNames
public String[] getAttributeNames()
Description copied from interface:ConfigurationElementBase
Gets the names of all attributes.- Specified by:
getAttributeNames
in interfaceConfigurationElementBase<DomElement>
- Returns:
- The array of names, which may be empty.
-
getChild
public DomElement getChild(String elementName)
Description copied from interface:ConfigurationElementBase
Gets the child element with the specified element name.- Specified by:
getChild
in interfaceConfigurationElementBase<DomElement>
- Parameters:
elementName
- The element name.- Returns:
- The child element or
null
if no such could be found.
-
getChildren
public DomElement[] getChildren()
Description copied from interface:ConfigurationElementBase
Gets all children.- Specified by:
getChildren
in interfaceConfigurationElementBase<DomElement>
- Returns:
- The array of children, which may be empty.
-
getChildren
public DomElement[] getChildren(String elementName)
Description copied from interface:ConfigurationElementBase
Gets all children with the specified element name.- Specified by:
getChildren
in interfaceConfigurationElementBase<DomElement>
- Parameters:
elementName
- The element name.- Returns:
- The array of children, which may be empty.
-
getChild
public DomElement getChild(int index)
- Specified by:
getChild
in interfaceDomElement
-
getChildCount
public int getChildCount()
- Specified by:
getChildCount
in interfaceDomElement
-
createChild
public DomElement createChild(String name)
- Specified by:
createChild
in interfaceDomElement
-
addChild
public void addChild(DomElement child)
- Specified by:
addChild
in interfaceDomElement
-
toXml
public String toXml()
- Specified by:
toXml
in interfaceDomElement
-
-