public class Project extends java.lang.Object implements XMLWriteable
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
RELATIVE_PATHS |
static java.lang.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(java.lang.String auxClasspathEntry)
Add an auxiliary classpath entry
|
boolean |
addFile(java.lang.String fileName)
Add a file to the project.
|
boolean |
addSourceDir(java.lang.String dirName)
Add a source directory to the project.
|
void |
addTimestamp(long timestamp) |
boolean |
addWorkingDir(java.lang.String dirName)
Add a working directory to the project.
|
static <T> java.util.List<T> |
appendWithoutDuplicates(java.util.List<T> lst1,
java.util.List<T> lst2) |
Project |
duplicate()
Return an exact copy of this Project.
|
java.lang.String |
getAuxClasspathEntry(int n)
Get the n'th auxiliary classpath entry.
|
java.util.List<java.lang.String> |
getAuxClasspathEntryList()
Return the list of aux classpath entries.
|
java.lang.String |
getCloudId() |
java.util.Properties |
getCloudProperties() |
UserPreferences |
getConfiguration() |
java.lang.String |
getFile(int num)
Get the given file in the list of project files.
|
java.lang.String[] |
getFileArray()
Get project files as an array of Strings.
|
int |
getFileCount()
Get the number of files in the project.
|
java.util.List<java.lang.String> |
getFileList()
Get the list of files, directories, and zip files in the project.
|
IGuiCallback |
getGuiCallback() |
java.util.List<java.lang.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.
|
java.lang.Boolean |
getPluginStatus(Plugin plugin) |
java.lang.String |
getProjectName() |
java.lang.Iterable<java.lang.String> |
getResolvedSourcePaths() |
java.lang.String |
getSourceDir(int num)
Get the given source directory.
|
java.lang.String[] |
getSourceDirArray()
Get source dirs as an array of Strings.
|
java.util.List<java.lang.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(java.lang.String argument)
Read Project from named file.
|
static Project |
readXML(java.io.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(java.lang.String cloudId) |
void |
setCloudProperties(java.util.Properties cloudProperties) |
void |
setConfiguration(UserPreferences configuration) |
void |
setCurrentWorkingDirectory(java.io.File f) |
void |
setGuiCallback(IGuiCallback guiCallback) |
void |
setModified(boolean isModified)
Set whether or not this Project has unsaved modifications.
|
void |
setPluginStatusTrinary(java.lang.String pluginId,
java.lang.Boolean enabled) |
void |
setProjectName(java.lang.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.
|
java.lang.String |
toString()
Convert to a string in a nice (displayable) format.
|
static java.lang.String |
transformFilename(java.lang.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(java.lang.String outputFile,
boolean useRelativePaths,
java.lang.String relativeBase)
Deprecated.
|
void |
writeXML(java.io.File f,
BugCollection bugCollection) |
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput.
|
void |
writeXML(XMLOutput xmlOutput,
java.io.File destination,
BugCollection bugCollection) |
public static final java.lang.String UNNAMED_PROJECT
public static final java.lang.String RELATIVE_PATHS
@CheckForNull public java.lang.Boolean getPluginStatus(Plugin plugin)
public void setPluginStatusTrinary(java.lang.String pluginId,
java.lang.Boolean enabled)
public UserPreferences getConfiguration()
public void setConfiguration(@Nonnull
UserPreferences configuration)
configuration - The configuration to set, non null@CheckForNull public java.lang.String getCloudId()
public void setCloudId(@Nullable
java.lang.String cloudId)
public java.util.Properties getCloudProperties()
public void setCloudProperties(java.util.Properties cloudProperties)
cloudProperties - The cloudProperties to set.public Project duplicate()
public SourceFinder getSourceFinder()
public boolean isGuiAvaliable()
public void add(Project project2)
public static <T> java.util.List<T> appendWithoutDuplicates(java.util.List<T> lst1,
java.util.List<T> lst2)
public void setCurrentWorkingDirectory(java.io.File f)
public boolean isModified()
public void setModified(boolean isModified)
public boolean addFile(java.lang.String fileName)
fileName - the file to addpublic boolean addSourceDir(java.lang.String dirName)
dirName - the directory to addpublic boolean addWorkingDir(java.lang.String dirName)
dirName - the directory to addpublic int getFileCount()
public java.lang.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 java.util.List<java.lang.String> getFileList()
public int getNumSourceDirs()
public java.lang.String getSourceDir(int num)
num - the number of the source directorypublic void removeSourceDir(int num)
num - index of the source directory to removepublic java.lang.String[] getFileArray()
public java.lang.String[] getSourceDirArray()
public java.util.List<java.lang.String> getSourceDirList()
public boolean addAuxClasspathEntry(java.lang.String auxClasspathEntry)
auxClasspathEntry - the entrypublic int getNumAuxClasspathEntries()
public java.lang.String getAuxClasspathEntry(int n)
public void removeAuxClasspathEntry(int n)
public java.util.List<java.lang.String> getAuxClasspathEntryList()
@Deprecated public java.util.List<java.lang.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(java.lang.String outputFile,
boolean useRelativePaths,
java.lang.String relativeBase)
throws java.io.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 relativejava.io.IOException - if an error occurs while writingpublic static Project readXML(java.io.File f) throws java.io.IOException, org.xml.sax.SAXException
java.io.IOExceptionorg.xml.sax.SAXExceptionpublic void writeXML(java.io.File f,
@CheckForNull
BugCollection bugCollection)
throws java.io.IOException
java.io.IOExceptionpublic static Project readProject(java.lang.String argument) throws java.io.IOException
argument - command line argument containing project file namejava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String transformFilename(java.lang.String fileName)
public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
XMLWriteablewriteXML in interface XMLWriteablexmlOutput - the XMLOutput for the documentjava.io.IOExceptionpublic void writeXML(XMLOutput xmlOutput, @CheckForNull java.io.File destination, @CheckForNull BugCollection bugCollection) throws java.io.IOException
java.io.IOExceptionpublic void setTimestamp(long timestamp)
public void addTimestamp(long timestamp)
public long getTimestamp()
public void setProjectName(java.lang.String projectName)
public java.lang.String getProjectName()
public void setSuppressionFilter(@Nonnull
Filter suppressionFilter)
@Nonnull public Filter getSuppressionFilter()
public void setGuiCallback(IGuiCallback guiCallback)
public IGuiCallback getGuiCallback()
public java.lang.Iterable<java.lang.String> getResolvedSourcePaths()
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.