Package com.sodius.mdw.metamodel.xml
Interface Element
-
- All Superinterfaces:
Comparable<Object>,ContentElement,org.eclipse.emf.ecore.EModelElement,org.eclipse.emf.ecore.EObject,MDWEObject,MDWObject,org.eclipse.emf.common.notify.Notifier
public interface Element extends ContentElement
A representation of the model object ' Element'.The following features are supported:
- See Also:
XmlPackage.getElement()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CommentcreateComment(String comment)Creates a comment, owned by this element.ElementcreateElement(String name)Creates a new child element with the specified tag name.ElementcreateElement(String name, Map<String,String> nameAndValues)Creates a new child element with the specified tag name and attributes.TextcreateText(String text)Creates a text content, owned by this element.ElementcreateTextElement(String name, String text)Creates a new child element with the specified tag name and text content.StringgetAttribute(String name)Returns the value of the attribute matching the specified name.booleangetAttribute(String name, boolean defaultValue)Returns the boolean value of the attribute matching the specified name, using a default value if not found.StringgetAttribute(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.ElementgetElement(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.StringgetTagName()Returns the value of the 'Tag Name' attribute.voidsetAttribute(String name, String value)Update the value of the attribute matching the specified name.voidsetAttributes(Map<String,String> nameAndValues)Update the values of the attributes matching the specified names.voidsetTagName(String value)Sets the value of the 'Tag Name' attribute.-
Methods inherited from interface com.sodius.mdw.metamodel.xml.ContentElement
getParent, setParent
-
Methods inherited from interface org.eclipse.emf.ecore.EModelElement
getEAnnotation, getEAnnotations
-
Methods inherited from interface org.eclipse.emf.ecore.EObject
eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset
-
Methods inherited from interface com.sodius.mdw.core.model.MDWObject
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
-
-
-
-
Method Detail
-
getTagName
String getTagName()
Returns the value of the 'Tag Name' attribute. The default value is"".- Returns:
- the value of the 'Tag Name' attribute.
- See Also:
setTagName(String),XmlPackage.getElement_TagName()
-
setTagName
void setTagName(String value)
Sets the value of the 'Tag Name' attribute.- Parameters:
value- the new value of the 'Tag Name' attribute.- See Also:
getTagName()
-
getAttributes
MDWEList<Attribute> getAttributes()
Returns the value of the 'Attributes' containment reference list. The list contents are of typeAttribute. It is bidirectional and its opposite is 'Parent'.- Returns:
- the value of the 'Attributes' containment reference list.
- See Also:
XmlPackage.getElement_Attributes(),Attribute.getParent()
-
getContent
MDWEList<ContentElement> getContent()
Returns the value of the 'Content' containment reference list. The list contents are of typeContentElement. It is bidirectional and its opposite is 'Parent'.- Returns:
- the value of the 'Content' containment reference list.
- See Also:
XmlPackage.getElement_Content(),ContentElement.getParent()
-
getAttribute
String getAttribute(String name)
Returns the value of the attribute matching the specified name.- Parameters:
name- the attribute name.- Returns:
- the value of the attribute matching the specified name,
nullif none.
-
getAttribute
String getAttribute(String name, String defaultValue)
Returns the value of the attribute matching the specified name, using a default value if not found.- Parameters:
name- the attribute name.defaultValue- the default value to return if the attribute is not defined.- Returns:
- the value of the attribute matching the specified name, the specified default value if none.
-
getAttribute
boolean getAttribute(String name, boolean defaultValue)
Returns the boolean value of the attribute matching the specified name, using a default value if not found.- Parameters:
name- the attribute name.defaultValue- the default value to return if the attribute is not defined.- Returns:
- the value of the attribute matching the specified name, the specified default value if none.
-
setAttribute
void setAttribute(String name, String value)
Update the value of the attribute matching the specified name. An attribute is added if one does not yet exist.- Parameters:
name- the attribute name.value- the attribute value.
-
setAttributes
void setAttributes(Map<String,String> nameAndValues)
Update the values of the attributes matching the specified names. An attribute is added if one does not yet exist.- Parameters:
nameAndValues- pairs of attribute name/value.
-
getElement
Element getElement(String name)
Returns the first direct child element whose tag matches the specified name.- Parameters:
name- the name of the element.- Returns:
- the first direct child element whose tag matches the specified name,
nullif none.
-
getElements
MDWList<Element> getElements(String name)
Returns the list of direct child elements whose tag matches the specified name.- Parameters:
name- the name of the element.- Returns:
- the list of direct child elements whose tag matches the specified name.
-
createElement
Element createElement(String name)
Creates a new child element with the specified tag name.- Parameters:
name- the element tag name.- Returns:
- the created element.
-
createElement
Element createElement(String name, Map<String,String> nameAndValues)
Creates a new child element with the specified tag name and attributes.- Parameters:
name- the element tag name.nameAndValues- pairs of attribute name/value to assign on the created element.- Returns:
- the created element.
- See Also:
setAttributes(Map)
-
createTextElement
Element createTextElement(String name, String text)
Creates a new child element with the specified tag name and text content.- Parameters:
name- the element tag name.text- the text content to assign.- Returns:
- the created element, which has a
Textcontent. - See Also:
createText(String)
-
createComment
Comment createComment(String comment)
Creates a comment, owned by this element.- Parameters:
comment- the comment text.- Returns:
- the created comment.
-
-