Class SearchLocationRegistry
- java.lang.Object
-
- ghidra.app.util.bin.format.dwarf4.external.SearchLocationRegistry
-
public class SearchLocationRegistry extends java.lang.Object
List ofSearchLocation
types that can be saved / restored from a configuration string.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SearchLocationRegistry.SearchLocationCreator
-
Constructor Summary
Constructors Constructor Description SearchLocationRegistry(boolean registerDefault)
Creates a new registry, optionally registering the default SearchLocations.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SearchLocation
createSearchLocation(java.lang.String locString, SearchLocationCreatorContext context)
Creates aSearchLocation
using the provided location string.static SearchLocationRegistry
getInstance()
SearchLocationCreatorContext
newContext(Program program)
Creates a newcontext
.void
register(java.util.function.Predicate<java.lang.String> testFunc, SearchLocationRegistry.SearchLocationCreator createFunc)
Adds aSearchLocation
to this registry.
-
-
-
Constructor Detail
-
SearchLocationRegistry
public SearchLocationRegistry(boolean registerDefault)
Creates a new registry, optionally registering the default SearchLocations.- Parameters:
registerDefault
- boolean flag, if true register the built-inSearchLocation
s
-
-
Method Detail
-
getInstance
public static SearchLocationRegistry getInstance()
-
register
public void register(java.util.function.Predicate<java.lang.String> testFunc, SearchLocationRegistry.SearchLocationCreator createFunc)
Adds aSearchLocation
to this registry.- Parameters:
testFunc
- aPredicate
that tests a location string, returning true if the string specifies the SearchLocation in questioncreateFunc
- aSearchLocationRegistry.SearchLocationCreator
that will create a newSearchLocation
instance given a location string and acontext
-
newContext
public SearchLocationCreatorContext newContext(Program program)
Creates a newcontext
.- Parameters:
program
-Program
- Returns:
- new
SearchLocationCreatorContext
-
createSearchLocation
public SearchLocation createSearchLocation(java.lang.String locString, SearchLocationCreatorContext context)
Creates aSearchLocation
using the provided location string.- Parameters:
locString
- location string (previously returned bySearchLocation.getName()
context
- acontext
- Returns:
- new
SearchLocation
instance, or null if there are no registered matching SearchLocations
-
-