Top Description Fields Constructors Methods
org.apache.tools.ant.types.optional.depend

public Class DependScanner

extends DirectoryScanner
Class Inheritance
Imports
java.io.File, java.util.Set, .Vector, java.util.stream.Collectors, .Stream, org.apache.tools.ant.BuildException, .DirectoryScanner, org.apache.tools.ant.types.Path, org.apache.tools.ant.util.StreamUtils, org.apache.tools.ant.util.depend.DependencyAnalyzer

DirectoryScanner for finding class dependencies.

Field Summary

Modifier and TypeField and Description
private Vector<File>
public static final String
DEFAULT_ANALYZER_CLASS

The name of the analyzer to use by default.

private Vector<String>
included

The names of the classes to include in the fileset.

private DirectoryScanner
parentScanner

The parent scanner which gives the basic set of files.

private Vector<String>
rootClasses

The root classes to drive the search for dependent classes.

Inherited from org.apache.tools.ant.DirectoryScanner:
basedirDEFAULTEXCLUDESdirsDeselecteddirsExcludeddirsIncludeddirsNotIncludedDOES_NOT_EXIST_POSTFIXerrorOnMissingDireverythingIncludedexcludesfilesDeselectedfilesExcludedfilesIncludedfilesNotIncludedhaveSlowResultsincludesisCaseSensitiveMAX_LEVELS_OF_SYMLINKSselectors

Constructor Summary

AccessConstructor and Description
public
DependScanner(DirectoryScanner
the DirectoryScanner which returns the files from which class files must come.
parentScanner
)

Create a DependScanner, using the given scanner to provide the basic set of files from which class files come.

Method Summary

Modifier and TypeMethod and Description
public void
addBasedir(File baseDir)

public void
public String[]
getExcludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getExcludedDirectories.

Implements org.apache.tools.ant.FileScanner.getExcludedDirectories.

Return the names of the directories which matched at least one of the include patterns and at least one of the exclude patterns.
public String[]
getExcludedFiles()

Overrides org.apache.tools.ant.DirectoryScanner.getExcludedFiles.

Implements org.apache.tools.ant.FileScanner.getExcludedFiles.

Return the names of the files which matched at least one of the include patterns and at least one of the exclude patterns.
public String[]
getIncludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedDirectories.

Implements org.apache.tools.ant.FileScanner.getIncludedDirectories.

Return the names of the directories which matched at least one of the include patterns and none of the exclude patterns.
public int
getIncludedDirsCount()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedDirsCount.

Return the count of included directories.
public String[]

Returns:

the names of the files.
getIncludedFiles
()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedFiles.

Implements org.apache.tools.ant.FileScanner.getIncludedFiles.

Get the names of the class files on which baseClass depends.
public synchronized int
public String[]
getNotIncludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getNotIncludedDirectories.

Implements org.apache.tools.ant.FileScanner.getNotIncludedDirectories.

Return the names of the directories which matched none of the include patterns.
public String[]
getNotIncludedFiles()

Overrides org.apache.tools.ant.DirectoryScanner.getNotIncludedFiles.

Implements org.apache.tools.ant.FileScanner.getNotIncludedFiles.

Return the names of the files which matched none of the include patterns.
public synchronized void
scan()

Overrides org.apache.tools.ant.DirectoryScanner.scan.

Implements org.apache.tools.ant.FileScanner.scan.

Scans the base directory for files on which baseClass depends.
public void
setCaseSensitive(boolean
whether or not the file system should be regarded as a case sensitive one.
isCaseSensitive
)

Overrides org.apache.tools.ant.DirectoryScanner.setCaseSensitive.

Implements org.apache.tools.ant.FileScanner.setCaseSensitive.

Set whether or not include and exclude patterns are matched in a case sensitive way.
public void
setExcludes(String[]
A list of exclude patterns. May be null, indicating that no files should be excluded. If a non-null list is given, all elements must be non-null.
excludes
)

Overrides org.apache.tools.ant.DirectoryScanner.setExcludes.

Implements org.apache.tools.ant.FileScanner.setExcludes.

Set the list of exclude patterns to use.
public void
setIncludes(String[]
A list of include patterns. May be null, indicating that all files should be included. If a non-null list is given, all elements must be non-null.
includes
)

Overrides org.apache.tools.ant.DirectoryScanner.setIncludes.

Implements org.apache.tools.ant.FileScanner.setIncludes.

Set the list of include patterns to use.
public synchronized void
setRootClasses(Vector<String>
the rootClasses to be used for this scan.
rootClasses
)

Sets the root classes to be used to drive the scan.

Inherited from org.apache.tools.ant.DirectoryScanner:
addDefaultExcludeaddExcludesclearResultscouldHoldIncludedgetBasedirgetDefaultExcludesgetDeselectedDirectoriesgetDeselectedFilesgetNotFollowedSymlinksgetResourceisCaseSensitiveisEverythingIncludedisExcludedisFollowSymlinksisIncludedisSelectedmatchmatchmatchPathmatchPathmatchPatternStartmatchPatternStartremoveDefaultExcluderesetDefaultExcludesscandirsetBasedirsetBasedirsetErrorOnMissingDirsetFollowSymlinkssetMaxLevelsOfSymlinkssetSelectorsslowScan

Field Detail

additionalBaseDirsback to summary
private Vector<File> additionalBaseDirs
DEFAULT_ANALYZER_CLASSback to summary
public static final String DEFAULT_ANALYZER_CLASS

The name of the analyzer to use by default.

includedback to summary
private Vector<String> included

The names of the classes to include in the fileset.

parentScannerback to summary
private DirectoryScanner parentScanner

The parent scanner which gives the basic set of files. Only files which are in this set and which can be reached from a root class will end up being included in the result set.

rootClassesback to summary
private Vector<String> rootClasses

The root classes to drive the search for dependent classes.

Constructor Detail

DependScannerback to summary
public DependScanner(DirectoryScanner parentScanner)

Create a DependScanner, using the given scanner to provide the basic set of files from which class files come.

Parameters
parentScanner:DirectoryScanner

the DirectoryScanner which returns the files from which class files must come.

Method Detail

addBasedirback to summary
public void addBasedir(File baseDir)
addDefaultExcludesback to summary
public void addDefaultExcludes()

Overrides org.apache.tools.ant.DirectoryScanner.addDefaultExcludes.

Implements org.apache.tools.ant.FileScanner.addDefaultExcludes.

Doc from org.apache.tools.ant.DirectoryScanner.addDefaultExcludes.

Add default exclusions to the current exclusions set.

Annotations
@Override
See Also
DirectoryScanner#addDefaultExcludes
getExcludedDirectoriesback to summary
public String[] getExcludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getExcludedDirectories.

Implements org.apache.tools.ant.FileScanner.getExcludedDirectories.

Doc from org.apache.tools.ant.DirectoryScanner.getExcludedDirectories.

Return the names of the directories which matched at least one of the include patterns and at least one of the exclude patterns. The names are relative to the base directory. This involves performing a slow scan if one has not already been completed.

Returns:String[]

the names of the directories which matched at least one of the include patterns and at least one of the exclude patterns.

Annotations
@Override
See Also
.
getExcludedFilesback to summary
public String[] getExcludedFiles()

Overrides org.apache.tools.ant.DirectoryScanner.getExcludedFiles.

Implements org.apache.tools.ant.FileScanner.getExcludedFiles.

Doc from org.apache.tools.ant.DirectoryScanner.getExcludedFiles.

Return the names of the files which matched at least one of the include patterns and at least one of the exclude patterns. The names are relative to the base directory. This involves performing a slow scan if one has not already been completed.

Returns:String[]

the names of the files which matched at least one of the include patterns and at least one of the exclude patterns.

Annotations
@Override
See Also
.
getIncludedDirectoriesback to summary
public String[] getIncludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedDirectories.

Implements org.apache.tools.ant.FileScanner.getIncludedDirectories.

Doc from org.apache.tools.ant.DirectoryScanner.getIncludedDirectories.

Return the names of the directories which matched at least one of the include patterns and none of the exclude patterns. The names are relative to the base directory.

Returns:String[]

the names of the directories which matched at least one of the include patterns and none of the exclude patterns.

Annotations
@Override
See Also
.
getIncludedDirsCountback to summary
public int getIncludedDirsCount()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedDirsCount.

Doc from org.apache.tools.ant.DirectoryScanner.getIncludedDirsCount.

Return the count of included directories.

Returns:int

int.

Annotations
@Override
See Also
.
getIncludedFilesback to summary
public String[] getIncludedFiles()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedFiles.

Implements org.apache.tools.ant.FileScanner.getIncludedFiles.

Get the names of the class files on which baseClass depends.

Returns:String[]

the names of the files.

Annotations
@Override
getIncludedFilesCountback to summary
public synchronized int getIncludedFilesCount()

Overrides org.apache.tools.ant.DirectoryScanner.getIncludedFilesCount.

Doc from org.apache.tools.ant.DirectoryScanner.getIncludedFilesCount.

Return the count of included files..

Returns:int

int.

Annotations
@Override
getNotIncludedDirectoriesback to summary
public String[] getNotIncludedDirectories()

Overrides org.apache.tools.ant.DirectoryScanner.getNotIncludedDirectories.

Implements org.apache.tools.ant.FileScanner.getNotIncludedDirectories.

Doc from org.apache.tools.ant.DirectoryScanner.getNotIncludedDirectories.

Return the names of the directories which matched none of the include patterns. The names are relative to the base directory. This involves performing a slow scan if one has not already been completed.

Returns:String[]

the names of the directories which matched none of the include patterns.

Annotations
@Override
See Also
.
getNotIncludedFilesback to summary
public String[] getNotIncludedFiles()

Overrides org.apache.tools.ant.DirectoryScanner.getNotIncludedFiles.

Implements org.apache.tools.ant.FileScanner.getNotIncludedFiles.

Doc from org.apache.tools.ant.DirectoryScanner.getNotIncludedFiles.

Return the names of the files which matched none of the include patterns. The names are relative to the base directory. This involves performing a slow scan if one has not already been completed.

Returns:String[]

the names of the files which matched none of the include patterns.

Annotations
@Override
See Also
.
scanback to summary
public synchronized void scan() throws IllegalStateException

Overrides org.apache.tools.ant.DirectoryScanner.scan.

Implements org.apache.tools.ant.FileScanner.scan.

Scans the base directory for files on which baseClass depends.

Annotations
@Override
Exceptions
IllegalStateException:
when basedir was set incorrectly.
setCaseSensitiveback to summary
public void setCaseSensitive(boolean isCaseSensitive)

Overrides org.apache.tools.ant.DirectoryScanner.setCaseSensitive.

Implements org.apache.tools.ant.FileScanner.setCaseSensitive.

Doc from org.apache.tools.ant.DirectoryScanner.setCaseSensitive.

Set whether or not include and exclude patterns are matched in a case sensitive way.

Parameters
isCaseSensitive:boolean

whether or not the file system should be regarded as a case sensitive one.

Annotations
@Override
See Also
.
setExcludesback to summary
public void setExcludes(String[] excludes)

Overrides org.apache.tools.ant.DirectoryScanner.setExcludes.

Implements org.apache.tools.ant.FileScanner.setExcludes.

Doc from org.apache.tools.ant.DirectoryScanner.setExcludes.

Set the list of exclude patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not match File.separatorChar.

When a pattern ends with a '/' or '\', "**" is appended.

Parameters
excludes:String[]

A list of exclude patterns. May be null, indicating that no files should be excluded. If a non-null list is given, all elements must be non-null.

Annotations
@Override
See Also
.
setIncludesback to summary
public void setIncludes(String[] includes)

Overrides org.apache.tools.ant.DirectoryScanner.setIncludes.

Implements org.apache.tools.ant.FileScanner.setIncludes.

Doc from org.apache.tools.ant.DirectoryScanner.setIncludes.

Set the list of include patterns to use. All '/' and '\' characters are replaced by File.separatorChar, so the separator used need not match File.separatorChar.

When a pattern ends with a '/' or '\', "**" is appended.

Parameters
includes:String[]

A list of include patterns. May be null, indicating that all files should be included. If a non-null list is given, all elements must be non-null.

Annotations
@Override
See Also
.
setRootClassesback to summary
public synchronized void setRootClasses(Vector<String> rootClasses)

Sets the root classes to be used to drive the scan.

Parameters
rootClasses:Vector<String>

the rootClasses to be used for this scan.