com.bbn.swede.core.resources
Class OWLDocument

java.lang.Object
  extended bycom.bbn.swede.core.resources.OWLElement
      extended bycom.bbn.swede.core.resources.OWLDocument
All Implemented Interfaces:
IOWLDocument, IOWLElement
Direct Known Subclasses:
OWLExternalDocument

public class OWLDocument
extends OWLElement
implements IOWLDocument

Implementation for OWL file elements.

Author:
jlerner

Field Summary
protected  Map _mapGenLocs
          A map containing the location of the output for any code generator run on this document.
protected  String _uri
          The base URI of the document.
 
Fields inherited from class com.bbn.swede.core.resources.OWLElement
_elemParent, _info, _resource, _sElementName
 
Constructor Summary
(package private) OWLDocument(IFile file)
          Creates an OWL document element based on an Eclipse file resource.
 
Method Summary
 Object getAdapter(Class adapter)
           
 IOWLElement getCorrespondingElement(IResource resource)
          Locates the OWL Element corresponding to a particular Eclipse resource.
 OWLDocumentInfo getDocumentInfo()
          Returns document-specific element information.
 IFile getFile()
          Returns the Eclipse file resource that is the basis for this OWLDocument.
 IPath getGeneratedCodeLocation(String sGeneratorID)
          Determines if a particular code generator has been run against this document and returns the path of the generated files.
 Map getGeneratedCodeMap()
          Returns the map of generated code locations.
 String getLocalURI()
          Returns a file: URI indicating the resource's location on the filesystem.
 String getURI()
          Returns the URI that is the xml:base of the document.
 void setGeneratedCodeLocation(String sGeneratorID, IPath path)
          Associates a path with a particular code generator for this document.
 void setURI(String uri)
          Sets the base URI of the document.
 
Methods inherited from class com.bbn.swede.core.resources.OWLElement
accept, contains, getCorrespondingResource, getElementInfo, getElementName, getParent, getPath, getResource, isReadOnly, setElementName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.bbn.swede.core.IOWLElement
accept, contains, getCorrespondingResource, getElementInfo, getElementName, getParent, getPath, getResource, isReadOnly, setParent
 

Field Detail

_uri

protected String _uri
The base URI of the document.


_mapGenLocs

protected Map _mapGenLocs
A map containing the location of the output for any code generator run on this document. The keys are the generator IDs from the plug-in manifest.

Constructor Detail

OWLDocument

OWLDocument(IFile file)
Creates an OWL document element based on an Eclipse file resource.

Parameters:
file - The Eclipse file
Method Detail

getDocumentInfo

public OWLDocumentInfo getDocumentInfo()
Description copied from interface: IOWLDocument
Returns document-specific element information.

Specified by:
getDocumentInfo in interface IOWLDocument
Returns:
OWLDocumentInfo object that can be used to access the details of a document

getCorrespondingElement

public IOWLElement getCorrespondingElement(IResource resource)
Description copied from interface: IOWLElement
Locates the OWL Element corresponding to a particular Eclipse resource.

Specified by:
getCorrespondingElement in interface IOWLElement
Overrides:
getCorrespondingElement in class OWLElement

getFile

public IFile getFile()
Description copied from interface: IOWLDocument
Returns the Eclipse file resource that is the basis for this OWLDocument.

Specified by:
getFile in interface IOWLDocument
Returns:
the document's inner IFile

getAdapter

public Object getAdapter(Class adapter)
Overrides:
getAdapter in class OWLElement

getURI

public String getURI()
Description copied from interface: IOWLDocument
Returns the URI that is the xml:base of the document. If no URI has been explicitly set, a file: specifying its location on the filesystem is used.

Specified by:
getURI in interface IOWLDocument
Overrides:
getURI in class OWLElement

setURI

public void setURI(String uri)
            throws MalformedURIException
Description copied from interface: IOWLDocument
Sets the base URI of the document.

Specified by:
setURI in interface IOWLDocument
Parameters:
uri - The new base URI
Throws:
MalformedURIException

getLocalURI

public String getLocalURI()
Description copied from interface: IOWLElement
Returns a file: URI indicating the resource's location on the filesystem.

Specified by:
getLocalURI in interface IOWLElement
Overrides:
getLocalURI in class OWLElement

getGeneratedCodeLocation

public IPath getGeneratedCodeLocation(String sGeneratorID)
Description copied from interface: IOWLDocument
Determines if a particular code generator has been run against this document and returns the path of the generated files. The returned path may specify either a file or folder, depending on the number of files created by the specified generator.

Specified by:
getGeneratedCodeLocation in interface IOWLDocument
Parameters:
sGeneratorID - The extension ID of the code generator
Returns:
The project-relative path of the generated code, or null if the specified generator has not been run against this document.

setGeneratedCodeLocation

public void setGeneratedCodeLocation(String sGeneratorID,
                                     IPath path)
Description copied from interface: IOWLDocument
Associates a path with a particular code generator for this document. At most one path can be associated with a document for each code generator.

Specified by:
setGeneratedCodeLocation in interface IOWLDocument
Parameters:
sGeneratorID - The generator to associate with the path
path - The path of the code generated by the specified generator. If null is provided as the path, the document will be disassociated from the code generator.

getGeneratedCodeMap

public Map getGeneratedCodeMap()
Description copied from interface: IOWLDocument
Returns the map of generated code locations. The keys are the generator IDs and the values are the project-relative paths of the generated code.

Specified by:
getGeneratedCodeMap in interface IOWLDocument
Returns:
The map of generated code locations


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