com.bbn.swede.core
Interface IOWLElement

All Known Subinterfaces:
IOWLClass, IOWLDocument, IOWLExternalDocument, IOWLFolder, IOWLLibrary, IOWLModel, IOWLProject, IOWLProperty
All Known Implementing Classes:
LibraryOWLDocument, OWLClass, OWLDocument, OWLElement, OWLExternalDocument, OWLFolder, OWLLibrary, OWLModel, OWLProject, OWLProperty

public interface IOWLElement

Common protocol for all elements provided by the OWL model.

Author:
jlerner, tself

Method Summary
 void accept(IOWLElementVisitor visitor)
          Accepts the given visitor.
 boolean contains(IResource resource)
          Checks if this element or one of its decendents is based on a particular Eclipse resource.
 IOWLElement getCorrespondingElement(IResource resource)
          Locates the OWL Element corresponding to a particular Eclipse resource.
 IResource getCorrespondingResource()
          Returns the resource that corresponds to this element.
 OWLElementInfo getElementInfo()
          Returns the OWLElementInfo for an OWL resource, creating it first if this is the first time it has been requested.
 String getElementName()
          Returns the name of this element.
 String getLocalURI()
          Returns a file: URI indicating the resource's location on the filesystem.
 IOWLElement getParent()
          Returns the element directly containing this element.
 IPath getPath()
          Returns the path to the innermost resource enclosing this element.
 IResource getResource()
          Returns the innermost enclosing resource of this element.
 String getURI()
          Returns the URI of the OWL element, or null if it has no URI.
 boolean isReadOnly()
          Indicates whether the OWL element is read-only.
 void setParent(IOWLElement elem)
          Sets the parent of this element.
 

Method Detail

getParent

public IOWLElement getParent()
Returns the element directly containing this element.

Returns:
the parent element, or null if it has no parent.

setParent

public void setParent(IOWLElement elem)
Sets the parent of this element.

Parameters:
elem - The parent element

getPath

public IPath getPath()
Returns the path to the innermost resource enclosing this element. This is the full path relative to the workbench

Returns:
the path to the innermost enclosing resource

getResource

public IResource getResource()
Returns the innermost enclosing resource of this element. This may be a resource that corresponds directly to this element.

Returns:
the innermost enclosing resource of this element

getCorrespondingResource

public IResource getCorrespondingResource()
Returns the resource that corresponds to this element. Not all OWL elements have a corresponding resource.

Returns:
the corresponding resource or null if none exists.

getElementName

public String getElementName()
Returns the name of this element.

Returns:
the element name

isReadOnly

public boolean isReadOnly()
Indicates whether the OWL element is read-only.

Returns:
true if this element is read-only

getURI

public String getURI()
Returns the URI of the OWL element, or null if it has no URI.

Returns:
the full URI of the element or null to indicate no URI

getLocalURI

public String getLocalURI()
Returns a file: URI indicating the resource's location on the filesystem.

Returns:
String of the local URI

contains

public boolean contains(IResource resource)
Checks if this element or one of its decendents is based on a particular Eclipse resource.

Parameters:
resource - The resource to attempt to locate
Returns:
true if the specified IResource corresponds to an OWL element descended from this one

getElementInfo

public OWLElementInfo getElementInfo()
Returns the OWLElementInfo for an OWL resource, creating it first if this is the first time it has been requested.

Returns:
an OWLElementInfo instance with detailed information about the element

getCorrespondingElement

public IOWLElement getCorrespondingElement(IResource resource)
Locates the OWL Element corresponding to a particular Eclipse resource.

Parameters:
resource - An Eclipse resource to locate in the OWL model
Returns:
The OWL Element that corresponds directly to resource, or null if there is no such element

accept

public void accept(IOWLElementVisitor visitor)
Accepts the given visitor. The visitor's visit method is called with this element. If the visitor returns true, this method will also visit the element's children.

Parameters:
visitor - The visitor


Copyright © 2004-2005 BBN Technologies. All Rights Reserved.