public class ElementFinder
extends java.lang.Object
Constructor and Description |
---|
ElementFinder() |
Modifier and Type | Method and Description |
---|---|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElements()
Returns a list of all elements in the model, inclusive of the data
element (the first element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElements(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
Returns a list of elements under the indicated parent, inclusive of the
parent (the first element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElementsByHumanName(java.lang.String elementHumanName)
Retrieves all elements in the project with the specified human name in the
model inclusive of the root (the first element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElementsByHumanName(java.lang.String elementHumanName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
Retrieves all elements in the project with the specified human name that are
owned by the specified element, inclusive of the parent (the first
element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> |
findElementsByName(java.lang.String elementName)
Retrieves all elements in the project with the specified name in the
model inclusive of the root (the first element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> |
findElementsByName(java.lang.String elementName,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
Retrieves all named elements in the project with the specified name that are
owned by the specified element, inclusive of the parent (the first
element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElementsByType(java.lang.String elementType)
Retrieves all elements in the project with the specified type, inclusive
of root (the first element in the list).
|
static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> |
findElementsByType(java.lang.String elementType,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
Retrieves all elements in the project with the specified type that are
owned by the specified parent, inclusive of parent (the first element in
the list).
|
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
findOwnedElementByName(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element owner,
java.lang.String name) |
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
getElement(java.lang.String type,
java.lang.String name)
Find the first occurrence of the listed element anywhere in the model,
inclusive of model root
|
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
getElement(java.lang.String type,
java.lang.String name,
com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element owner)
Find the first occurrence of the listed element under the supplied owner,
inclusive of the owner
|
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
getElementByQualifiedName(java.lang.String qualifiedName,
com.nomagic.magicdraw.core.Project project)
Deprecated.
|
static int |
getEmptyDiagramCount() |
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
getModelRoot()
Retrieves the model root element.
|
static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element |
getPackageContainer(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element target)
Finds the first package that contains the target element
Generally used to find a container that holds an element known directly,
or in conjunction with getElementByID to find it's container.
|
public static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElements(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
parent
- The top level element whose owned elements you want to selectpublic static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElements()
public static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElementsByHumanName(java.lang.String elementHumanName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
elementHumanName
- HumanName of element, i.e. "Package New Container" or (type + " " + name)parent
- The top level element whose owned elements you want to search
throughpublic static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElementsByHumanName(java.lang.String elementHumanName)
elementHumanName
- HumanName of element, i.e. "Package New Container" or (type + " " + name)public static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> findElementsByName(java.lang.String elementName, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
elementName
- Name of elementparent
- The top level element whose owned elements you want to search
throughpublic static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element findOwnedElementByName(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element owner, java.lang.String name)
public static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.NamedElement> findElementsByName(java.lang.String elementName)
elementName
- Name of element.public static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElementsByType(java.lang.String elementType, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element parent)
elementType
- Type of element. ie. Package or Document.parent
- The top level element whose owned elements you want to search
throughpublic static java.util.List<com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element> findElementsByType(java.lang.String elementType)
elementType
- Type of element. ie. Package or Document.public static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element getElement(java.lang.String type, java.lang.String name, com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element owner)
type
- Type of desired elementname
- Name of desired elementowner
- Element under which you search for the indicated elementpublic static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element getElement(java.lang.String type, java.lang.String name)
type
- Type of desired elementname
- Name of desired element@Deprecated public static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element getElementByQualifiedName(java.lang.String qualifiedName, com.nomagic.magicdraw.core.Project project)
qualifiedName
- in the format of magicdraw's qualified name: ex "Package::hello::worldproject
- project to search the primary model onpublic static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element getModelRoot()
public static com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element getPackageContainer(com.nomagic.uml2.ext.magicdraw.classes.mdkernel.Element target)
target
- Element contained within the returned packagepublic static int getEmptyDiagramCount()