Package com.tonic.analysis.xref
Class XrefBuilder
- java.lang.Object
-
- com.tonic.analysis.xref.XrefBuilder
-
public class XrefBuilder extends Object
A builder for a cross-reference database over every class in a ClassPool, recording call, field access, instantiation, cast and inheritance references.
-
-
Constructor Summary
Constructors Constructor Description XrefBuilder(ClassPool classPool)Creates a builder that will scan the given pool into a fresh database.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description XrefDatabasebuild()Clears the database and rescans every class in the pool.XrefDatabasegetDatabase()voidsetProgressCallback(Consumer<String> callback)Sets a callback invoked with progress messages during the scan.
-
-
-
Constructor Detail
-
XrefBuilder
public XrefBuilder(ClassPool classPool)
Creates a builder that will scan the given pool into a fresh database.- Parameters:
classPool- the pool whose classes are scanned
-
-
Method Detail
-
getDatabase
public XrefDatabase getDatabase()
- Returns:
- the database being built, readable before the scan completes
-
setProgressCallback
public void setProgressCallback(Consumer<String> callback)
Sets a callback invoked with progress messages during the scan.- Parameters:
callback- the progress sink, or null to disable reporting
-
build
public XrefDatabase build()
Clears the database and rescans every class in the pool.- Returns:
- the populated database
-
-