Package net.sourceforge.pmd.cpd
Class CPD
- java.lang.Object
-
- net.sourceforge.pmd.cpd.CPD
-
public class CPD extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCPD.StatusCode
-
Constructor Summary
Constructors Constructor Description CPD(CPDConfiguration theConfiguration)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(File file)voidadd(List<File> files)voidadd(SourceCode sourceCode)voidadd(DBURI dburi)voidaddAllInDirectory(File dir)voidaddRecursively(File dir)Iterator<Match>getMatches()List<String>getSourcePaths()List names/paths of each source to be processed.List<SourceCode>getSources()Get each Source to be processed.voidgo()static voidmain(String[] args)Entry to invoke CPD as command line tool.static CPD.StatusCoderunCpd(String... args)Parses the command line and executes CPD.voidsetCpdListener(CPDListener cpdListener)CPDReporttoReport()
-
-
-
Constructor Detail
-
CPD
public CPD(CPDConfiguration theConfiguration)
-
-
Method Detail
-
setCpdListener
public void setCpdListener(CPDListener cpdListener)
-
go
public void go()
-
addAllInDirectory
public void addAllInDirectory(File dir) throws IOException
- Throws:
IOException
-
addRecursively
public void addRecursively(File dir) throws IOException
- Throws:
IOException
-
add
public void add(List<File> files) throws IOException
- Throws:
IOException
-
add
public void add(File file) throws IOException
- Throws:
IOException
-
add
public void add(DBURI dburi) throws IOException
- Throws:
IOException
-
add
@Experimental public void add(SourceCode sourceCode) throws IOException
- Throws:
IOException
-
getSourcePaths
public List<String> getSourcePaths()
List names/paths of each source to be processed.- Returns:
- names of sources to be processed
-
getSources
public List<SourceCode> getSources()
Get each Source to be processed.- Returns:
- all Sources to be processed
-
main
public static void main(String[] args)
Entry to invoke CPD as command line tool. Note that this will invokeSystem.exit(int).- Parameters:
args- command line arguments
-
runCpd
public static CPD.StatusCode runCpd(String... args)
Parses the command line and executes CPD. Returns the status code without exiting the VM.- Parameters:
args- command line arguments- Returns:
- the status code
-
toReport
public CPDReport toReport()
-
-