Package org.jtool.jxplatform.builder
Class IncrementalModelBuilder
java.lang.Object
org.jtool.jxplatform.builder.ModelBuilder
org.jtool.jxplatform.builder.IncrementalModelBuilder
A builder that incrementally builds models from Java source code.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Set<org.jtool.jxplatform.builder.IncrementalModelBuilder.FilePath>
The collection of files that are added.protected List<JavaProject>
A project that this builder is applied to.The collection of files that are removed.The collection of files that are updated.Fields inherited from class org.jtool.jxplatform.builder.ModelBuilder
br, builderImpl
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an incremental-mode model builder.IncrementalModelBuilder
(org.jtool.jxplatform.project.ModelBuilderImpl builderImpl) Creates an incremental-mode model builder.IncrementalModelBuilder
(org.jtool.jxplatform.project.ModelBuilderImpl builderImpl, List<JavaProject> jprojects) Creates an incremental-mode model builder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFile
(JavaProject jproject, String pathname) Registers a file that was added to the project.void
addFiles
(JavaProject jproject, Set<String> pathnames) Registers files that were added to the project.Builds a source code model for target projects.Builds a source code model for a target project.Builds a source code model for a target project.Builds a source code model for a target project.void
Clear the records of changed files.Returns the names of files that were added.Returns the project that this builder is applied to.Returns the names of files whose contents are obsolete.Returns the names of files that were removed.Returns the names of files that were updated.void
Builds a source code model based on added and removed files.void
Builds a source code model based on added and removed files.void
rebuild()
Re-builds a source code model from all files.void
removeFile
(JavaProject jproject, String pathname) Registers a file that was removed from the project.void
removeFiles
(JavaProject jproject, Set<String> pathnames) Registers files that were removed from the project.void
resetClassPath
(JavaProject jproject, String[] classPath) Resets the class paths.void
resetSourceBinaryPaths
(JavaProject jproject, String[] sourcePath, String[] binaryPath) Resets source paths and binary paths.void
unbuild()
Disposes the created models.void
updateFile
(JavaProject jproject, String pathname) Registers a file that was updated in the project.void
updateFiles
(JavaProject jproject, Set<String> pathnames) Registers files that were updated in the project.Methods inherited from class org.jtool.jxplatform.builder.ModelBuilder
analyzeBytecode, analyzeBytecode, copyJavaFile, findCCFG, findCFG, findClDG, findPDG, getAllClassesBackward, getAllClassesForward, getAllMethodsBackward, getAllMethodsForward, getCallGraph, getCCFG, getCCFG, getCFG, getCFG, getCFG, getCFG, getClDG, getClDG, getClDG, getClDG, getDependencyGraph, getDependencyGraph, getDependencyGraph, getgetDependencyGraph, getModelBuilderImpl, getPDG, getPDG, getPDG, getPDG, getPDG, getPDG, getSDG, getSDG, getUnregisteredJavaFile, getUnregisteredJavaFile, setBytecodeAnalysisLevel, setConsoleVisible, setSourcecodeAnalysisChain, useCache, useCache
-
Field Details
-
jprojects
A project that this builder is applied to. -
addedFiles
The collection of files that are added. -
removedFiles
The collection of files that are removed. -
updatedFiles
The collection of files that are updated.
-
-
Constructor Details
-
IncrementalModelBuilder
public IncrementalModelBuilder()Creates an incremental-mode model builder. -
IncrementalModelBuilder
public IncrementalModelBuilder(org.jtool.jxplatform.project.ModelBuilderImpl builderImpl) Creates an incremental-mode model builder.- Parameters:
builderImpl
- the implementation module of this model builder
-
IncrementalModelBuilder
public IncrementalModelBuilder(org.jtool.jxplatform.project.ModelBuilderImpl builderImpl, List<JavaProject> jprojects) Creates an incremental-mode model builder.- Parameters:
builderImpl
- the implementation of a model builderjprojects
- the collection of project data
-
-
Method Details
-
clearFiles
public void clearFiles()Clear the records of changed files. -
build
Description copied from class:ModelBuilder
Builds a source code model for target projects.- Overrides:
build
in classModelBuilder
- Parameters:
name
- the name of the created modeltarget
- the directory storing the target projects- Returns:
- the collection of created project data
-
build
Builds a source code model for a target project.- Overrides:
build
in classModelBuilder
- Parameters:
name
- the name of the created modeltarget
- the directory storing the target projectclasspath
- the path where the needed class (or jar) files are located- Returns:
- the created project data
-
build
public JavaProject build(String name, String target, String classpath, String srcpath, String binpath) Builds a source code model for a target project.- Overrides:
build
in classModelBuilder
- Parameters:
name
- the name of the created modeltarget
- the directory storing the target projectclasspath
- the path where the needed class (or jar) files are locatedsrcpath
- the path where the source files are locatedbinpath
- the path where the binary files are located- Returns:
- the created project data
-
build
public JavaProject build(String name, String target, String[] classpath, String[] srcpath, String[] binpath) Builds a source code model for a target project.- Overrides:
build
in classModelBuilder
- Parameters:
name
- the name of the created modeltarget
- the directory storing the target projectclasspath
- the collection of the paths where the needed class (or jar) files are locatedsrcpath
- the collection of the paths where the source files are locatedbinpath
- the collection of the paths where the binary files are located- Returns:
- the created project data
-
getJavaProjects
Returns the project that this builder is applied to.- Returns:
- the collection of projects
-
resetClassPath
Resets the class paths.- Parameters:
jproject
- a project whose class paths will be changedclassPath
- the absolute paths that store class files
-
resetSourceBinaryPaths
Resets source paths and binary paths.- Parameters:
jproject
- a project whose source and binary paths will be changedsourcePath
- the absolute paths that store source filesbinaryPath
- the absolute paths that store binary files
-
getAddedFileNames
Returns the names of files that were added.- Returns:
- the collection of the names of the added files
-
getRemovedFileNames
Returns the names of files that were removed.- Returns:
- the collection of the names of the removed files
-
getUpdatedFileNames
Returns the names of files that were updated.- Returns:
- the collection of the names of the updated files
-
getObsoleteFileNames
Returns the names of files whose contents are obsolete.- Returns:
- the collection of the names of the obsolete files
-
rebuild
public void rebuild()Re-builds a source code model from all files. -
incrementalBuildByFileTime
public void incrementalBuildByFileTime()Builds a source code model based on added and removed files. -
incrementalBuild
public void incrementalBuild()Builds a source code model based on added and removed files. -
unbuild
public void unbuild()Disposes the created models.- Overrides:
unbuild
in classModelBuilder
-
addFile
Registers a file that was added to the project.- Parameters:
jproject
- a project that contains the added filepathname
- the path name of the added file
-
addFiles
Registers files that were added to the project.- Parameters:
jproject
- a project that contains the added filespathnames
- the collection of path names of the added files
-
removeFile
Registers a file that was removed from the project.- Parameters:
jproject
- a project that contains the removed filepathname
- the path name of the removed file
-
removeFiles
Registers files that were removed from the project.- Parameters:
jproject
- a project that contains the removed filespathnames
- the collection of path names of the removed files
-
updateFile
Registers a file that was updated in the project.- Parameters:
jproject
- a project that contains the updated filepathname
- the path name of the updated file
-
updateFiles
Registers files that were updated in the project.- Parameters:
jproject
- a project that contains the updated filespathnames
- the collection of path names of the updated files
-