org.modeshape.sequencer.teiid.xmi
Class XmiElement
java.lang.Object
org.modeshape.sequencer.teiid.xmi.XmiBasePart
org.modeshape.sequencer.teiid.xmi.XmiElement
- All Implemented Interfaces:
- XmiDescendent, XmiPart
public class XmiElement
- extends XmiBasePart
- implements XmiDescendent
An element from an XMI file.
NAME_ATTR_NAME
public static final String NAME_ATTR_NAME
- The name of the attribute used as the name attribute. Defaults to "name" .
- See Also:
- Constant Field Values
XmiElement
public XmiElement(String name)
- Parameters:
name
- the element name (cannot be null
or empty)
addAttribute
public void addAttribute(XmiAttribute newAttribute)
- Parameters:
newAttribute
- the attribute being added (cannot be null
)
addChild
public void addChild(XmiElement newChild)
- Parameters:
newChild
- the child element being added (cannot be null
)
equals
public boolean equals(Object obj)
- Overrides:
equals
in class XmiBasePart
- See Also:
XmiBasePart.equals(java.lang.Object)
findChild
public XmiElement findChild(String childName,
String namespaceUri)
- Parameters:
childName
- the name of the child being requested (cannot be null
or empty)namespaceUri
- the URI of the attribute being requested (can be null
or empty)
- Returns:
- the requested child element or
null
if not found
getAttribute
public XmiAttribute getAttribute(String name,
String namespaceUri)
- Parameters:
name
- the name of the attribute being requested (cannot be null
or empty)namespaceUri
- the URI of the attribute being requested (can be null
or empty)
- Returns:
- the requested attribute or
null
if not found
getAttributes
public List<XmiAttribute> getAttributes()
- Returns:
- the attributes (never
null
but can be empty)
getAttributes
public List<XmiAttribute> getAttributes(String namespaceUri)
- Parameters:
namespaceUri
- the namespace URI of the attributes being requested (can be null
or empty)
- Returns:
- the requested attributes (never
null
but can be empty)
getAttributeValue
public String getAttributeValue(String name,
String namespaceUri)
- Parameters:
name
- the name of the attribute whose value is being requested (cannot be null
or empty)namespaceUri
- the namespace URI of the attribute being requested (can be null
or empty)
- Returns:
- the requested attribute value (which can be
null
or empty) or null
if not found
getChildren
public List<XmiElement> getChildren()
- Returns:
- the child elements (never
null
but can be empty)
getNameAttribute
public XmiAttribute getNameAttribute(String namespaceUri)
- Parameters:
namespaceUri
- the namespace URI of the name attribute being requested (can be null
or empty)
- Returns:
- the name attribute or
null
if not found
getNamespacePrefix
public String getNamespacePrefix()
- Specified by:
getNamespacePrefix
in interface XmiPart
- Overrides:
getNamespacePrefix
in class XmiBasePart
- Returns:
- the namespace prefix (can be
null
or empty) - See Also:
XmiBasePart.getNamespacePrefix()
getNamespaceUri
public String getNamespaceUri()
- Specified by:
getNamespaceUri
in interface XmiPart
- Overrides:
getNamespaceUri
in class XmiBasePart
- Returns:
- the namespace URI (can be
null
or empty) - See Also:
XmiBasePart.getNamespaceUri()
getParent
public XmiElement getParent()
- Specified by:
getParent
in interface XmiDescendent
- Returns:
- the parent (can be
null
) - See Also:
XmiDescendent.getParent()
getUuid
public String getUuid()
- Returns:
- the XMI UUID or
null
if not set
hashCode
public int hashCode()
- Overrides:
hashCode
in class XmiBasePart
- See Also:
XmiBasePart.hashCode()
setParent
public void setParent(XmiElement parent)
- Specified by:
setParent
in interface XmiDescendent
- Parameters:
parent
- the new parent (can be null
)- See Also:
XmiDescendent.setParent(org.modeshape.sequencer.teiid.xmi.XmiElement)
toString
public String toString()
- Overrides:
toString
in class XmiBasePart
- See Also:
Object.toString()
Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.