public interface Element extends ContentElement
The following features are supported:
XmlPackage.getElement()
Modifier and Type | Method and Description |
---|---|
Comment |
createComment(String comment)
Creates a comment, owned by this element.
|
Element |
createElement(String name)
Creates a new child element with the specified tag name.
|
Element |
createElement(String name,
Map<String,String> nameAndValues)
Creates a new child element with the specified tag name and attributes.
|
Text |
createText(String text)
Creates a text content, owned by this element.
|
Element |
createTextElement(String name,
String text)
Creates a new child element with the specified tag name and text content.
|
String |
getAttribute(String name)
Returns the value of the attribute matching the specified name.
|
boolean |
getAttribute(String name,
boolean defaultValue)
Returns the boolean value of the attribute matching the specified name, using a default value if not found.
|
String |
getAttribute(String name,
String defaultValue)
Returns the value of the attribute matching the specified name, using a default value if not found.
|
MDWEList<Attribute> |
getAttributes()
Returns the value of the 'Attributes' containment reference list.
|
MDWEList<ContentElement> |
getContent()
Returns the value of the 'Content' containment reference list.
|
Element |
getElement(String name)
Returns the first direct child element whose tag matches the specified name.
|
MDWList<Element> |
getElements(String name)
Returns the list of direct child elements whose tag matches the specified name.
|
String |
getTagName()
Returns the value of the 'Tag Name' attribute.
|
void |
setAttribute(String name,
String value)
Update the value of the attribute matching the specified name.
|
void |
setAttributes(Map<String,String> nameAndValues)
Update the values of the attributes matching the specified names.
|
void |
setTagName(String value)
Sets the value of the '
Tag Name ' attribute. |
getParent, setParent
compareTo, eExtendedClass, eIsInstanceOf, eIsInstanceOf, eIsProfiled, eIsRemoved, eMetamodel, eMetaTypeName, eModel, eRemove, eSetUniqueID, eUniqueID, superScript, superScript, toBoolean, toBoolean, toByte, toByte, toChar, toChar, toDouble, toDouble, toFloat, toFloat, toInt, toInt, toList, toList, toList, toList, toList, toLong, toLong, toObject, toObject, toSet, toSet, toShort, toShort, toString, toString
getEAnnotation, getEAnnotations
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
eAdapters, eDeliver, eNotify, eSetDeliver
String getTagName()
""
.
setTagName(String)
,
XmlPackage.getElement_TagName()
void setTagName(String value)
Tag Name
' attribute.
value
- the new value of the 'Tag Name' attribute.getTagName()
MDWEList<Attribute> getAttributes()
Attribute
.
It is bidirectional and its opposite is 'Parent
'.
XmlPackage.getElement_Attributes()
,
Attribute.getParent()
MDWEList<ContentElement> getContent()
ContentElement
.
It is bidirectional and its opposite is 'Parent
'.
XmlPackage.getElement_Content()
,
ContentElement.getParent()
String getAttribute(String name)
name
- the attribute name.null
if none.String getAttribute(String name, String defaultValue)
name
- the attribute name.defaultValue
- the default value to return if the attribute is not defined.boolean getAttribute(String name, boolean defaultValue)
name
- the attribute name.defaultValue
- the default value to return if the attribute is not defined.void setAttribute(String name, String value)
name
- the attribute name.value
- the attribute value.void setAttributes(Map<String,String> nameAndValues)
nameAndValues
- pairs of attribute name/value.Element getElement(String name)
name
- the name of the element.null
if none.MDWList<Element> getElements(String name)
name
- the name of the element.Element createElement(String name)
name
- the element tag name.Element createElement(String name, Map<String,String> nameAndValues)
name
- the element tag name.nameAndValues
- pairs of attribute name/value to assign on the created element.setAttributes(Map)
Element createTextElement(String name, String text)
name
- the element tag name.text
- the text content to assign.Text
content.createText(String)
Comment createComment(String comment)
comment
- the comment text.