public class ModelUtils extends Object
| Constructor and Description |
|---|
ModelUtils() |
| Modifier and Type | Method and Description |
|---|---|
static IAttribute |
getAttributeByOriginalName(IClassifier container,
String originalName,
boolean includeInherited)
Finds an attribute within the given
IClassifier whose originalName matches
that specified. |
static String |
getLocation(IPackage pkg)
Return the file location (a URL as a String) that a package was loaded from.
|
static String |
getXMLNamespaceURI(IAttribute attr)
Return the namespace an attribute is in.
|
static String |
getXMLNamespaceURI(IModelElement element)
Return the namespace an model element (i.e.
|
static String |
getXSDPath(IAttribute attr)
Return an XPath to an attribute inside a schema.
|
static boolean |
isAttributeAnXMLAttribute(IAttribute attr)
Return true if an attribute represents an XML attribute (as opposed to an XML
element).
|
static boolean |
isAttributeAnXMLElement(IAttribute attr)
Return true if an attribute represents an XML element (rather than an XML
attribute).
|
static boolean |
isRenamedXSDAttribute(IAttribute attr)
Returnt true if an attribute is an XML attribute or element that had to be renamed
by the model loader due to a naming conflict.
|
static boolean |
isXSDModelElement(IModelElement modelElement)
Detects if an
IModelElement originates from an XSD model i.e. |
public static IAttribute getAttributeByOriginalName(IClassifier container, String originalName, boolean includeInherited)
IClassifier whose originalName matches
that specified.container - The IClassifier to search for attributes.originalName - The name of the attribute as specified in the original e.g. XSDincludeInherited - public static String getLocation(IPackage pkg)
pkg - the packagepublic static String getXMLNamespaceURI(IAttribute attr)
attr - the attributepublic static String getXMLNamespaceURI(IModelElement element)
element - the model elementpublic static String getXSDPath(IAttribute attr)
isRenamedXSDAttribute(IAttribute) returns true and can be used by
applications that require JAXB bindings.attr - the attributepublic static boolean isAttributeAnXMLElement(IAttribute attr)
isAttributeAnXMLAttribute(IAttribute) instead.attr - the attributepublic static boolean isAttributeAnXMLAttribute(IAttribute attr)
isAttributeAnXMLElement(IAttribute) to find out if it's an
XML element.attr - the attributepublic static boolean isRenamedXSDAttribute(IAttribute attr)
attr - the attributepublic static boolean isXSDModelElement(IModelElement modelElement)
IModelElement originates from an XSD model i.e. is it an
XSDPackage, XSDClassifier or XSDDataType.modelElement - the IModelElement to inspectCopyright © 2006-2013. All Rights Reserved.