public class Project extends Object implements XMLWriteable
Modifier and Type | Field and Description |
---|---|
static String |
RELATIVE_PATHS |
static String |
UNNAMED_PROJECT
StaticConstant used to name anonymous projects.
|
Constructor and Description |
---|
Project()
Create an anonymous project.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Project project2)
add information from project2 to this project
|
boolean |
addAuxClasspathEntry(String auxClasspathEntry)
Add an auxiliary classpath entry
|
boolean |
addFile(String fileName)
Add a file to the project.
|
boolean |
addSourceDir(String dirName)
Add a source directory to the project.
|
void |
addTimestamp(long timestamp) |
boolean |
addWorkingDir(String dirName)
Add a working directory to the project.
|
static <T> List<T> |
appendWithoutDuplicates(List<T> lst1,
List<T> lst2) |
Project |
duplicate()
Return an exact copy of this Project.
|
String |
getAuxClasspathEntry(int n)
Get the n'th auxiliary classpath entry.
|
List<String> |
getAuxClasspathEntryList()
Return the list of aux classpath entries.
|
String |
getCloudId() |
Properties |
getCloudProperties() |
UserPreferences |
getConfiguration() |
String |
getFile(int num)
Get the given file in the list of project files.
|
String[] |
getFileArray()
Get project files as an array of Strings.
|
int |
getFileCount()
Get the number of files in the project.
|
List<String> |
getFileList()
Get the list of files, directories, and zip files in the project.
|
IGuiCallback |
getGuiCallback() |
List<String> |
getImplicitClasspathEntryList()
Deprecated.
FindBugs2 and ClassPathBuilder take care of this
automatically
|
int |
getNumAuxClasspathEntries()
Get the number of auxiliary classpath entries.
|
int |
getNumSourceDirs()
Get the number of source directories in the project.
|
Boolean |
getPluginStatus(Plugin plugin) |
String |
getProjectName() |
Iterable<String> |
getResolvedSourcePaths() |
String |
getSourceDir(int num)
Get the given source directory.
|
String[] |
getSourceDirArray()
Get source dirs as an array of Strings.
|
List<String> |
getSourceDirList()
Get the source dir list.
|
SourceFinder |
getSourceFinder() |
Filter |
getSuppressionFilter() |
long |
getTimestamp() |
boolean |
isGuiAvaliable() |
boolean |
isModified()
Return whether or not this Project has unsaved modifications.
|
static Project |
readProject(String argument)
Read Project from named file.
|
static Project |
readXML(File f) |
void |
removeAuxClasspathEntry(int n)
Remove the n'th auxiliary classpath entry.
|
void |
removeFile(int num)
Remove file at the given index in the list of project files
|
void |
removeSourceDir(int num)
Remove source directory at given index.
|
void |
setCloudId(String cloudId) |
void |
setCloudProperties(Properties cloudProperties) |
void |
setConfiguration(UserPreferences configuration) |
void |
setCurrentWorkingDirectory(File f) |
void |
setGuiCallback(IGuiCallback guiCallback) |
void |
setModified(boolean isModified)
Set whether or not this Project has unsaved modifications.
|
void |
setPluginStatusTrinary(String pluginId,
Boolean enabled) |
void |
setProjectName(String projectName) |
void |
setSuppressionFilter(Filter suppressionFilter) |
void |
setTimestamp(long timestamp)
Make the given list of pathnames absolute relative to the absolute path
of the project file.
|
String |
toString()
Convert to a string in a nice (displayable) format.
|
static String |
transformFilename(String fileName)
Transform a user-entered filename into a proper filename, by adding the
".fb" file extension if it isn't already present.
|
void |
write(String outputFile,
boolean useRelativePaths,
String relativeBase)
Deprecated.
|
void |
writeXML(File f,
BugCollection bugCollection) |
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput.
|
void |
writeXML(XMLOutput xmlOutput,
File destination,
BugCollection bugCollection) |
public static final String UNNAMED_PROJECT
public static final String RELATIVE_PATHS
@CheckForNull public Boolean getPluginStatus(Plugin plugin)
public UserPreferences getConfiguration()
public void setConfiguration(@Nonnull UserPreferences configuration)
configuration
- The configuration to set, non null@CheckForNull public String getCloudId()
public Properties getCloudProperties()
public void setCloudProperties(Properties cloudProperties)
cloudProperties
- The cloudProperties to set.public Project duplicate()
public SourceFinder getSourceFinder()
public boolean isGuiAvaliable()
public void add(Project project2)
public static <T> List<T> appendWithoutDuplicates(List<T> lst1, List<T> lst2)
public void setCurrentWorkingDirectory(File f)
public boolean isModified()
public void setModified(boolean isModified)
public boolean addFile(String fileName)
fileName
- the file to addpublic boolean addSourceDir(String dirName)
dirName
- the directory to addpublic boolean addWorkingDir(String dirName)
dirName
- the directory to addpublic int getFileCount()
public String getFile(int num)
num
- the number of the file in the list of project filespublic void removeFile(int num)
num
- index of the file to remove in the list of project filespublic List<String> getFileList()
public int getNumSourceDirs()
public String getSourceDir(int num)
num
- the number of the source directorypublic void removeSourceDir(int num)
num
- index of the source directory to removepublic String[] getFileArray()
public String[] getSourceDirArray()
public boolean addAuxClasspathEntry(String auxClasspathEntry)
auxClasspathEntry
- the entrypublic int getNumAuxClasspathEntries()
public String getAuxClasspathEntry(int n)
public void removeAuxClasspathEntry(int n)
public List<String> getAuxClasspathEntryList()
@Deprecated public List<String> getImplicitClasspathEntryList()
"Class-Path"
attribute of the manifest of the any jar
file that is part of this project or by the "Class-Path"
attribute of any directly or indirectly referenced jar. The referenced
jar files that exist are the list of implicit classpath entries.@Deprecated public void write(String outputFile, boolean useRelativePaths, String relativeBase) throws IOException
outputFile
- name of output fileuseRelativePaths
- true if the project should be written using only relative
pathsrelativeBase
- if useRelativePaths is true, this file is taken as the base
directory in terms of which all files should be made relativeIOException
- if an error occurs while writingpublic static Project readXML(File f) throws IOException, SAXException
IOException
SAXException
public void writeXML(File f, @CheckForNull BugCollection bugCollection) throws IOException
IOException
public static Project readProject(String argument) throws IOException
argument
- command line argument containing project file nameIOException
public String toString()
public static String transformFilename(String fileName)
public void writeXML(XMLOutput xmlOutput) throws IOException
XMLWriteable
writeXML
in interface XMLWriteable
xmlOutput
- the XMLOutput for the documentIOException
public void writeXML(XMLOutput xmlOutput, @CheckForNull File destination, @CheckForNull BugCollection bugCollection) throws IOException
IOException
public void setTimestamp(long timestamp)
public void addTimestamp(long timestamp)
public long getTimestamp()
public void setProjectName(String projectName)
public String getProjectName()
public void setGuiCallback(IGuiCallback guiCallback)
public IGuiCallback getGuiCallback()
Copyright © 2003–2015. All rights reserved.