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
Constant 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 |
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.
|
boolean |
getOption(java.lang.String option)
Deprecated.
|
java.lang.String |
getProjectFileName()
Deprecated.
|
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.
|
java.lang.String |
projectNameFromProjectFileName() |
void |
read(java.lang.String inputFile)
Deprecated.
|
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 |
setCurrentWorkingDirectory(java.io.File f) |
void |
setGuiCallback(IGuiCallback guiCallback) |
void |
setModified(boolean isModified)
Set whether or not this Project has unsaved modifications.
|
void |
setProjectFileName(java.lang.String projectFileName)
Deprecated.
|
void |
setProjectName(java.lang.String projectName) |
void |
setSuppressionFilter(Filter suppressionFilter) |
void |
setTimestamp(long timestamp) |
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) |
void |
writeXML(XMLOutput xmlOutput)
Write this object to given XMLOutput.
|
void |
writeXML(XMLOutput xmlOutput,
java.lang.Object destination) |
public static final java.lang.String UNNAMED_PROJECT
public static final java.lang.String RELATIVE_PATHS
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)
@Deprecated public java.lang.String getProjectFileName()
@Deprecated public void setProjectFileName(java.lang.String projectFileName)
projectFileName
- the new filenamepublic 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 add@Deprecated public boolean getOption(java.lang.String option)
option
- the name of option to getpublic 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.dom4j.DocumentException, org.xml.sax.SAXException
java.io.IOException
org.dom4j.DocumentException
org.xml.sax.SAXException
public void writeXML(java.io.File f) throws java.io.IOException
java.io.IOException
@Deprecated public void read(java.lang.String inputFile) throws java.io.IOException
inputFile
- name of the input file to read the project fromjava.io.IOException
- if an error occurs while readingpublic static Project readProject(java.lang.String argument) throws java.io.IOException
argument
- command line argument containing project file namejava.io.IOException
public java.lang.String projectNameFromProjectFileName()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String transformFilename(java.lang.String fileName)
public void writeXML(XMLOutput xmlOutput) throws java.io.IOException
XMLWriteable
writeXML
in interface XMLWriteable
xmlOutput
- the XMLOutput for the documentjava.io.IOException
public void writeXML(XMLOutput xmlOutput, @CheckForNull java.lang.Object destination) throws java.io.IOException
java.io.IOException
public void setTimestamp(long timestamp)
timestamp
- The timestamp to set.public void addTimestamp(long timestamp)
public long getTimestamp()
public void setProjectName(java.lang.String projectName)
projectName
- The projectName to set.public java.lang.String getProjectName()
public void setSuppressionFilter(Filter suppressionFilter)
suppressionFilter
- The suppressionFilter to set.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.