com.bbn.swede.core.config
Class SWProjectInfo

java.lang.Object
  extended bycom.bbn.swede.core.config.SWProjectInfo

public final class SWProjectInfo
extends Object

Contains utility methods for interacting with Semantic Web project info files. This includes reading the file, rebuilding it based on the contents of the OWL model, and requesting individual values for specific files. Yeah.

Author:
rblace

Field Summary
static String S_FILE_NAME
          The filename used for the Semantic Web project info file.
 
Method Summary
static String getDocumentSourceURL(IFile fileIn)
          Retrieves a document's source URL from the project info file.
static String getDocumentURI(IFile fileIn)
          Retrieves a document's URI from the project info file.
static Map getGeneratedCodeMap(IFile fileIn)
          Retrieves the list of generated code locations for a document.
static ILibraryDescriptor[] getLibraries(IProject proj)
          Retrieves a project's Ontology Library dependencies from the project info file.
static boolean infoFileExists(IProject project)
          Indicates whether or not a project has a project info file.
static boolean isExternal(IFile fileIn)
          Indicates whether a file is an external OWL document.
static void refreshInfoFile(IProject project)
          Refreshes the config file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

S_FILE_NAME

public static final String S_FILE_NAME
The filename used for the Semantic Web project info file.

See Also:
Constant Field Values
Method Detail

refreshInfoFile

public static void refreshInfoFile(IProject project)
Refreshes the config file. This rebuilds the file based on the current state of the OWL model in memory.

Parameters:
project - The project to build the config file for.

isExternal

public static boolean isExternal(IFile fileIn)
Indicates whether a file is an external OWL document.

Parameters:
fileIn - The file to check.
Returns:
boolean true if the file is an external document, false if not.

getLibraries

public static ILibraryDescriptor[] getLibraries(IProject proj)
Retrieves a project's Ontology Library dependencies from the project info file.

Parameters:
proj - The project
Returns:
An array of library descriptors for the Ontology libraries referenced by the project.

getDocumentURI

public static String getDocumentURI(IFile fileIn)
Retrieves a document's URI from the project info file. For external documents, this is not necessarily the same URI it was imported from. That URI is stored as the source URL of the external document.

Parameters:
fileIn - The file whose URI to return
Returns:
String The base URI of the file, or null if it is not an OWL document.
See Also:
getDocumentSourceURL(IFile)

getDocumentSourceURL

public static String getDocumentSourceURL(IFile fileIn)
Retrieves a document's source URL from the project info file. This is the URL from which an external document was originally imported. Regular documents do not have a source URL.

Parameters:
fileIn - The file whose source URL to return
Returns:
The source URL of the file, or null if it is not an external OWL document.

getGeneratedCodeMap

public static Map getGeneratedCodeMap(IFile fileIn)
Retrieves the list of generated code locations for a document. This indicates which code generators have been run against it and where the file(s) they created are located.

Parameters:
fileIn - The file whose generated code map to return
Returns:
A map of generated code locations. The map is indexed by ID string, as returned by AbstractCodeGenerator.getID(), and stores the locations as instances of IPath.

infoFileExists

public static boolean infoFileExists(IProject project)
Indicates whether or not a project has a project info file.

Parameters:
project - The project to check for an info file.
Returns:
true if the project has an info file, false if not.


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