Modifier and Type | Method and Description |
---|---|
default boolean |
exists()
Returns whether this element exists in the model.
|
default <T> T |
getAncestor(java.lang.Class<T> ancestorType)
Returns the closest ancestor of this element that has the given type
(excluding this element).
|
default IElement[] |
getChildren()
Returns the immediate children of this element.
|
default <T> T[] |
getChildren(java.lang.Class<T> childType)
Returns the immediate children of this element that have the given type.
|
default java.net.URI |
getLocationUri()
Returns a file system location for this element.
|
default java.lang.String |
getName()
Returns the name of this element, or
null
if this element has no name. |
default IElement |
getParent()
Returns the element directly containing this element,
or
null if this element has no parent. |
default org.eclipse.core.resources.IResource |
getResource()
Returns the innermost resource enclosing this element, or
null
if this element is not enclosed in a workspace resource. |
default IElement |
getRoot()
Returns the root element containing this element.
|
default java.lang.String getName()
null
if this element has no name. This is a handle-only method.null
if this element has no namedefault IElement getParent()
null
if this element has no parent.
This is a handle-only method.null
if this element has
no parentdefault IElement getRoot()
null
)default <T> T getAncestor(java.lang.Class<T> ancestorType)
null
if no such ancestor
can be found. This is a handle-only method.ancestorType
- the given type (not null
)null
if no such ancestor
can be founddefault org.eclipse.core.resources.IResource getResource()
null
if this element is not enclosed in a workspace resource.
This is a handle-only method.
Note that it is safe to call this method and test the return value
for null
even when org.eclipse.core.resources
bundle is not available.
null
if this element is not enclosed in a workspace resourcedefault java.net.URI getLocationUri()
EFS.getStore(URI)
. Returns
null
if no location can be determined.null
if no location can be determineddefault boolean exists()
Handles may or may not be backed by an actual element. Handles that are backed by an actual element are said to "exist".
true
if this element exists in the model, and
false
if this element does not existdefault IElement[] getChildren() throws org.eclipse.core.runtime.CoreException
null
).
Clients must not modify the returned array.org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourcedefault <T> T[] getChildren(java.lang.Class<T> childType) throws org.eclipse.core.runtime.CoreException
childType
- the given type (not null
)null
). Clients must not modify the returned
array.org.eclipse.core.runtime.CoreException
- if this element does not exist or if an
exception occurs while accessing its corresponding resourceCopyright (c) 2014, 2018 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0