|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.nrl.parser.model.ModelUtils
public class ModelUtils
Utility methods for working with model objects.
Constructor Summary | |
---|---|
ModelUtils()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ModelUtils()
Method Detail |
---|
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 package
public static String getXMLNamespaceURI(IAttribute attr)
attr
- the attribute
public static String getXMLNamespaceURI(IModelElement element)
element
- the model element
public static String getXSDPath(IAttribute attr)
isRenamedXSDAttribute(IAttribute)
returns true and can be used by
applications that require JAXB bindings.
attr
- the attribute
public static boolean isAttributeAnXMLElement(IAttribute attr)
isAttributeAnXMLAttribute(IAttribute)
instead.
attr
- the attribute
public static boolean isAttributeAnXMLAttribute(IAttribute attr)
isAttributeAnXMLElement(IAttribute)
to find out if it's an
XML element.
attr
- the attribute
public static boolean isRenamedXSDAttribute(IAttribute attr)
attr
- the attribute
public static boolean isXSDModelElement(IModelElement modelElement)
IModelElement
originates from an XSD model i.e. is it an
XSDPackage
, XSDClassifier
or XSDDataType
.
modelElement
- the IModelElement
to inspect
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |