|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.drjava.project.ProjectProfile
public class ProjectProfile
The internal representation of a project; it is the internal analog of a project file. Includes support for writing corresponding project file.
| Field Summary | |
|---|---|
private boolean |
_autoRefreshStatus
|
private List<DocFile> |
_auxiliaryFiles
|
private List<FileRegion> |
_bookmarks
|
private List<DebugBreakpointData> |
_breakpoints
|
private File |
_buildDir
|
private List<AbsRelFile> |
_classPathFiles
|
private List<String> |
_collapsedPaths
|
private File |
_createJarFile
|
private int |
_createJarFlags
|
private List<DocFile> |
_excludedFiles
|
private String |
_mainClass
|
private String |
_manifest
|
private File |
_projectFile
|
private File |
_projectRoot
root of project source tree. |
private List<DocFile> |
_sourceFiles
|
private HashMap<OptionParser<?>,String> |
_storedPreferences
|
private String |
_version
|
private List<DebugWatchData> |
_watches
|
private File |
_workDir
|
private static Log |
LOG
|
(package private) static DateFormat |
MOD_DATE_FORMAT
|
(package private) static String |
MOD_DATE_FORMAT_STRING
|
| Constructor Summary | |
|---|---|
ProjectProfile(File f)
Creates new ProjectProfiles with specifed project file name and project root that is parent folder of the project file. |
|
ProjectProfile(String fileName)
Constructs a File for fileName and forwards this call to the main constructor. |
|
| Method Summary | |
|---|---|
void |
addAuxiliaryFile(DocFile df)
|
void |
addAuxiliaryFile(DocumentInfoGetter getter)
|
void |
addClassPathFile(AbsRelFile cp)
|
void |
addCollapsedPath(String cp)
|
void |
addExcludedFile(DocFile df)
|
void |
addExcludedFile(DocumentInfoGetter getter)
|
void |
addExcludedFile(File f)
|
void |
addSourceFile(DocFile df)
Public setters, modifiers |
void |
addSourceFile(DocumentInfoGetter getter)
|
private DocFile |
docFileFromGetter(DocumentInfoGetter g)
|
private String |
encodeBookmarkRelative(FileRegion bm,
String prefix)
This encodes a bookmark relative to _projectRoot. |
private String |
encodeBreakpointRelative(DebugBreakpointData bp,
String prefix)
This encodes a breakpoint relative to _projectRoot. |
private String |
encodeDocFile(DocFile df,
String prefix,
boolean relative)
This encodes a docfile, adding all the special tags that store document-specific information. |
private String |
encodeDocFileAbsolute(DocFile df,
String prefix)
|
private String |
encodeDocFileRelative(DocFile df,
String prefix)
Encodes a doc file relative to _projectRoot. |
private String |
encodeFileAbsolute(File f,
String prefix)
This encodes a normal file with its canonical path. |
private String |
encodeFileRelative(File f,
String prefix,
File base)
This encodes a normal file relative to File base. |
private String |
encodeWatch(DebugWatchData w,
String prefix)
This encodes a watch. |
boolean |
getAutoRefreshStatus()
|
DocFile[] |
getAuxiliaryFiles()
These files are the files outside of the project tree that are saved in the project file so that they are opened as well as the project files. |
FileRegion[] |
getBookmarks()
|
DebugBreakpointData[] |
getBreakpoints()
|
File |
getBuildDirectory()
|
Iterable<AbsRelFile> |
getClassPaths()
|
String[] |
getCollapsedPaths()
|
File |
getCreateJarFile()
|
int |
getCreateJarFlags()
|
String |
getCustomManifest()
Accessor for manifest attribute/ |
String |
getDrJavaVersion()
The version of dr java that created this project (as determined from its serialization as a .pjt or .drjava or .xml file) |
DocFile[] |
getExcludedFiles()
These files are in the project source tree, but have been explicitly excluded from the project. |
String |
getMainClass()
|
File |
getMainClassContainingFile()
|
Map<OptionParser<?>,String> |
getPreferencesStoredInProject()
|
File |
getProjectFile()
|
File |
getProjectRoot()
|
DocFile[] |
getSourceFiles()
|
DebugWatchData[] |
getWatches()
|
File |
getWorkingDirectory()
|
void |
setAutoRefreshStatus(boolean status)
|
void |
setAuxiliaryFiles(List<DocFile> af)
|
void |
setBookmarks(List<? extends FileRegion> bms)
|
void |
setBreakpoints(List<? extends DebugBreakpointData> bps)
|
void |
setBuildDirectory(File dir)
|
void |
setClassPaths(Iterable<? extends AbsRelFile> cpf)
|
void |
setCollapsedPaths(List<String> cp)
|
void |
setCreateJarFile(File createJarFile)
|
void |
setCreateJarFlags(int createJarFlags)
|
void |
setCustomManifest(String manifest)
Mutator for manifest attribute. |
void |
setDrJavaVersion(String version)
Sets the version of DrJava that built this project. |
void |
setExcludedFiles(List<DocFile> ef)
|
void |
setMainClass(String main)
|
void |
setPreferencesStoredInProject(Map<OptionParser<?>,String> sp)
|
void |
setProjectRoot(File root)
Assumes that root.getParentFile != null |
void |
setSourceFiles(List<DocFile> sf)
|
void |
setWatches(List<? extends DebugWatchData> ws)
|
void |
setWorkingDirectory(File dir)
|
String |
toString()
|
void |
write()
Write project file in XML format. |
void |
write(OutputStream os)
|
void |
writeOld()
This method writes what information has been passed to this builder so far to disk in s-expression format. |
void |
writeOld(Writer fw)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
static final String MOD_DATE_FORMAT_STRING
static final DateFormat MOD_DATE_FORMAT
private List<DocFile> _sourceFiles
private List<DocFile> _auxiliaryFiles
private List<DocFile> _excludedFiles
private List<String> _collapsedPaths
private File _buildDir
private File _workDir
private List<AbsRelFile> _classPathFiles
private String _mainClass
private File _projectRoot
private File _projectFile
private File _createJarFile
private int _createJarFlags
private boolean _autoRefreshStatus
private HashMap<OptionParser<?>,String> _storedPreferences
private List<FileRegion> _bookmarks
private List<DebugBreakpointData> _breakpoints
private List<DebugWatchData> _watches
private String _version
private String _manifest
private static Log LOG
| Constructor Detail |
|---|
public ProjectProfile(String fileName)
throws IOException
IOException
public ProjectProfile(File f)
throws IOException
IOException - parent directory of project file does not exist.| Method Detail |
|---|
public DocFile[] getSourceFiles()
getSourceFiles in interface ProjectFileIRpublic DocFile[] getAuxiliaryFiles()
ProjectFileIR
getAuxiliaryFiles in interface ProjectFileIRpublic DocFile[] getExcludedFiles()
ProjectFileIR
getExcludedFiles in interface ProjectFileIRpublic File getProjectFile()
getProjectFile in interface ProjectFileIRpublic File getBuildDirectory()
getBuildDirectory in interface ProjectFileIRpublic File getWorkingDirectory()
getWorkingDirectory in interface ProjectFileIRpublic String[] getCollapsedPaths()
getCollapsedPaths in interface ProjectFileIRpublic Iterable<AbsRelFile> getClassPaths()
getClassPaths in interface ProjectFileIRpublic String getMainClass()
getMainClass in interface ProjectFileIRpublic File getMainClassContainingFile()
getMainClassContainingFile in interface ProjectFileIRpublic File getProjectRoot()
getProjectRoot in interface ProjectFileIRpublic File getCreateJarFile()
getCreateJarFile in interface ProjectFileIRpublic int getCreateJarFlags()
getCreateJarFlags in interface ProjectFileIRpublic FileRegion[] getBookmarks()
getBookmarks in interface ProjectFileIRpublic DebugBreakpointData[] getBreakpoints()
getBreakpoints in interface ProjectFileIRpublic DebugWatchData[] getWatches()
getWatches in interface ProjectFileIRpublic boolean getAutoRefreshStatus()
getAutoRefreshStatus in interface ProjectFileIRpublic Map<OptionParser<?>,String> getPreferencesStoredInProject()
getPreferencesStoredInProject in interface ProjectFileIRpublic void addSourceFile(DocFile df)
public void addSourceFile(DocumentInfoGetter getter)
public void addAuxiliaryFile(DocFile df)
public void addAuxiliaryFile(DocumentInfoGetter getter)
public void addExcludedFile(DocFile df)
public void addExcludedFile(File f)
public void addExcludedFile(DocumentInfoGetter getter)
public void addClassPathFile(AbsRelFile cp)
public void addCollapsedPath(String cp)
public void setBuildDirectory(File dir)
setBuildDirectory in interface ProjectFileIRpublic void setWorkingDirectory(File dir)
setWorkingDirectory in interface ProjectFileIRpublic void setMainClass(String main)
setMainClass in interface ProjectFileIRpublic void setSourceFiles(List<DocFile> sf)
setSourceFiles in interface ProjectFileIRpublic void setClassPaths(Iterable<? extends AbsRelFile> cpf)
setClassPaths in interface ProjectFileIRpublic void setCollapsedPaths(List<String> cp)
setCollapsedPaths in interface ProjectFileIRpublic void setAuxiliaryFiles(List<DocFile> af)
setAuxiliaryFiles in interface ProjectFileIRpublic void setExcludedFiles(List<DocFile> ef)
setExcludedFiles in interface ProjectFileIRpublic void setProjectRoot(File root)
setProjectRoot in interface ProjectFileIRpublic void setCreateJarFile(File createJarFile)
setCreateJarFile in interface ProjectFileIRpublic void setCreateJarFlags(int createJarFlags)
setCreateJarFlags in interface ProjectFileIRpublic void setBookmarks(List<? extends FileRegion> bms)
setBookmarks in interface ProjectFileIRpublic void setBreakpoints(List<? extends DebugBreakpointData> bps)
setBreakpoints in interface ProjectFileIRpublic void setWatches(List<? extends DebugWatchData> ws)
setWatches in interface ProjectFileIRpublic void setAutoRefreshStatus(boolean status)
setAutoRefreshStatus in interface ProjectFileIRpublic void setPreferencesStoredInProject(Map<OptionParser<?>,String> sp)
setPreferencesStoredInProject in interface ProjectFileIR
public void write()
throws IOException
IOException
public void write(OutputStream os)
throws IOException
IOException
public void writeOld()
throws IOException
IOExceptionpublic String toString()
toString in class Object
public void writeOld(Writer fw)
throws IOException
IOException
private DocFile docFileFromGetter(DocumentInfoGetter g)
throws IOException
g - The getter that can get all the info needed to make the document file
IOException
private String encodeFileRelative(File f,
String prefix,
File base)
throws IOException
f - the file to encodeprefix - the indent level to place the s-expression atbase - Directory to be made relative to
IOException
private String encodeFileAbsolute(File f,
String prefix)
throws IOException
f - the file to encodeprefix - the indent level to place the s-expression at
IOException
private String encodeDocFile(DocFile df,
String prefix,
boolean relative)
throws IOException
df - the doc file to encodeprefix - the indent level to place the s-expression atrelative - whether this file should be made relative to _projectRoot
IOException
private String encodeDocFileRelative(DocFile df,
String prefix)
throws IOException
df - the DocFile to encodeprefix - the indent level
IOException
private String encodeDocFileAbsolute(DocFile df,
String prefix)
throws IOException
IOException
private String encodeBreakpointRelative(DebugBreakpointData bp,
String prefix)
throws IOException
bp - the breakpoint to encodeprefix - the indent level to place the s-expression at
IOException
private String encodeWatch(DebugWatchData w,
String prefix)
throws IOException
w - the watch to encodeprefix - the indent level to place the s-expression at
IOException
private String encodeBookmarkRelative(FileRegion bm,
String prefix)
throws IOException
bm - the bookmark to encodeprefix - the indent level to place the s-expression at
IOExceptionpublic String getDrJavaVersion()
ProjectFileIR
getDrJavaVersion in interface ProjectFileIRpublic void setDrJavaVersion(String version)
ProjectFileIR
setDrJavaVersion in interface ProjectFileIRversion - - the version string, should be called with "unknown" if the version could not be determined.public String getCustomManifest()
getCustomManifest in interface ProjectFileIRProjectFileIR.getCreateJarFlags()public void setCustomManifest(String manifest)
setCustomManifest in interface ProjectFileIR
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||