Package ghidra.app.services
Interface BlockModelService
- 
 public interface BlockModelServiceService for providing block models.
- 
- 
Field SummaryFields Modifier and Type Field Description static intBASIC_MODELType for a simple block model.static java.lang.StringDEFAULT_BLOCK_MODEL_NAMEDefault basic block model (Simple Block Model)static java.lang.StringDEFAULT_SUBROUTINE_MODEL_NAMEDefault subroutine model (M-Model)static java.lang.StringISOLATED_ENTRY_SUBROUTINE_MODEL_NAMEName of the implementation for a subroutine that has a unique entry point, which may share code with other subroutines.static java.lang.StringMULTI_ENTRY_SUBROUTINE_MODEL_NAMEName of the implementation for a subroutine with multiple entry points.static java.lang.StringOVERLAPPED_SUBROUTINE_MODEL_NAMEName of the implementation for an overlapped subroutine model.static java.lang.StringPARTITIONED_SUBROUTINE_MODEL_NAMEName of the implementation for a subroutine that does not share code with other subroutines and may have one or more entry points.static java.lang.StringSIMPLE_BLOCK_MODEL_NAMEName of the implementation for a Simple block model.static intSUBROUTINE_MODELType for a subroutine block model.
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddListener(BlockModelServiceListener listener)Add service listener.CodeBlockModelgetActiveBlockModel()Deprecated.use getActiveBlockModel(Program) insteadCodeBlockModelgetActiveBlockModel(boolean includeExternals)Deprecated.use getActiveBlockModel(Program, boolean) insteadCodeBlockModelgetActiveBlockModel(Program program)Get new instance of the active Basic Block model.CodeBlockModelgetActiveBlockModel(Program program, boolean includeExternals)Get new instance of the active Basic Block model.java.lang.StringgetActiveBlockModelName()Get the name of the active Basic Block model.CodeBlockModelgetActiveSubroutineModel()Deprecated.use getActiveSubroutineModel(Program) insteadCodeBlockModelgetActiveSubroutineModel(boolean includeExternals)Deprecated.use getActiveSubroutineModel(Program) insteadCodeBlockModelgetActiveSubroutineModel(Program program)Get new instance of the active Subroutine Block model.CodeBlockModelgetActiveSubroutineModel(Program program, boolean includeExternals)Get new instance of the active Subroutine Block model.java.lang.StringgetActiveSubroutineModelName()Get the name of the active Subroutine model.java.lang.String[]getAvailableModelNames(int modelType)Get list of registered block models of the specified type.CodeBlockModelgetNewModelByName(java.lang.String modelName)Deprecated.use getNewModelByName(String, Program) insteadCodeBlockModelgetNewModelByName(java.lang.String modelName, boolean includeExternals)Deprecated.use getNewModelByName(String, Program, boolean) insteadCodeBlockModelgetNewModelByName(java.lang.String modelName, Program program)Get new instance of the specified block model.CodeBlockModelgetNewModelByName(java.lang.String modelName, Program program, boolean includeExternals)Get new instance of the specified block model.voidregisterModel(java.lang.Class<? extends CodeBlockModel> modelClass, java.lang.String modelName)Register a new model.voidremoveListener(BlockModelServiceListener listener)Remove service listener.voidunregisterModel(java.lang.Class<? extends CodeBlockModel> modelClass)Deregister a model.
 
- 
- 
- 
Field Detail- 
BASIC_MODELstatic final int BASIC_MODEL Type for a simple block model.- See Also:
- SimpleBlockModel, Constant Field Values
 
 - 
SUBROUTINE_MODELstatic final int SUBROUTINE_MODEL Type for a subroutine block model.- See Also:
- Constant Field Values
 
 - 
SIMPLE_BLOCK_MODEL_NAMEstatic final java.lang.String SIMPLE_BLOCK_MODEL_NAME Name of the implementation for a Simple block model.- See Also:
- Constant Field Values
 
 - 
MULTI_ENTRY_SUBROUTINE_MODEL_NAMEstatic final java.lang.String MULTI_ENTRY_SUBROUTINE_MODEL_NAME Name of the implementation for a subroutine with multiple entry points.- See Also:
- Constant Field Values
 
 - 
ISOLATED_ENTRY_SUBROUTINE_MODEL_NAMEstatic final java.lang.String ISOLATED_ENTRY_SUBROUTINE_MODEL_NAME Name of the implementation for a subroutine that has a unique entry point, which may share code with other subroutines.- See Also:
- Constant Field Values
 
 - 
OVERLAPPED_SUBROUTINE_MODEL_NAMEstatic final java.lang.String OVERLAPPED_SUBROUTINE_MODEL_NAME Name of the implementation for an overlapped subroutine model.- See Also:
- Constant Field Values
 
 - 
PARTITIONED_SUBROUTINE_MODEL_NAMEstatic final java.lang.String PARTITIONED_SUBROUTINE_MODEL_NAME Name of the implementation for a subroutine that does not share code with other subroutines and may have one or more entry points.- See Also:
- Constant Field Values
 
 - 
DEFAULT_BLOCK_MODEL_NAMEstatic final java.lang.String DEFAULT_BLOCK_MODEL_NAME Default basic block model (Simple Block Model)- See Also:
- Constant Field Values
 
 - 
DEFAULT_SUBROUTINE_MODEL_NAMEstatic final java.lang.String DEFAULT_SUBROUTINE_MODEL_NAME Default subroutine model (M-Model)- See Also:
- Constant Field Values
 
 
- 
 - 
Method Detail- 
registerModelvoid registerModel(java.lang.Class<? extends CodeBlockModel> modelClass, java.lang.String modelName) Register a new model.- Parameters:
- modelClass- code block model class. Subroutine models must implement the SubroutineBlockMode interface - all other models are assumed to be basic block models.
- modelName- name of model
 
 - 
unregisterModelvoid unregisterModel(java.lang.Class<? extends CodeBlockModel> modelClass) Deregister a model.- Parameters:
- modelClass- code block model class.
 
 - 
getActiveBlockModel@Deprecated CodeBlockModel getActiveBlockModel() Deprecated.use getActiveBlockModel(Program) insteadGet new instance of the active Basic Block model for the current program.- Returns:
- new Basic Block model instance or null if program is not open.
 
 - 
getActiveBlockModel@Deprecated CodeBlockModel getActiveBlockModel(boolean includeExternals) Deprecated.use getActiveBlockModel(Program, boolean) insteadGet new instance of the active Basic Block model for the current program.- Parameters:
- includeExternals- externals are included if true
- Returns:
- new Basic Block model instance or null if program is not open.
 
 - 
getActiveBlockModelCodeBlockModel getActiveBlockModel(Program program) Get new instance of the active Basic Block model.- Parameters:
- program- program to associate with the block model
- Returns:
- new Basic Block model instance or null if program is null
 
 - 
getActiveBlockModelCodeBlockModel getActiveBlockModel(Program program, boolean includeExternals) Get new instance of the active Basic Block model.- Parameters:
- program- program to associate with the block model
- includeExternals- externals are included if true
- Returns:
- new Basic Block model instance or null if program is null
 
 - 
getActiveBlockModelNamejava.lang.String getActiveBlockModelName() Get the name of the active Basic Block model.- Returns:
- active block model name
 
 - 
getActiveSubroutineModel@Deprecated CodeBlockModel getActiveSubroutineModel() Deprecated.use getActiveSubroutineModel(Program) insteadGet new instance of the active Subroutine Block model for the current program.- Returns:
- new Subroutine Block model instance or null if program is not open
 
 - 
getActiveSubroutineModel@Deprecated CodeBlockModel getActiveSubroutineModel(boolean includeExternals) Deprecated.use getActiveSubroutineModel(Program) insteadGet new instance of the active Subroutine Block model for the current program.- Parameters:
- includeExternals- externals are included if true
- Returns:
- new Subroutine Block model instance or null if program is not open
 
 - 
getActiveSubroutineModelCodeBlockModel getActiveSubroutineModel(Program program) Get new instance of the active Subroutine Block model.- Parameters:
- program- program associated with the block model.
- Returns:
- new Subroutine Block model instance or null if program is null
 
 - 
getActiveSubroutineModelCodeBlockModel getActiveSubroutineModel(Program program, boolean includeExternals) Get new instance of the active Subroutine Block model.- Parameters:
- program- program associated with the block model.
- includeExternals- externals are included if true
- Returns:
- new Subroutine Block model instance or null if program is null
 
 - 
getActiveSubroutineModelNamejava.lang.String getActiveSubroutineModelName() Get the name of the active Subroutine model.- Returns:
- active subroutine model name
 
 - 
getNewModelByName@Deprecated CodeBlockModel getNewModelByName(java.lang.String modelName) throws NotFoundException Deprecated.use getNewModelByName(String, Program) insteadGet new instance of the specified block model.- Parameters:
- modelName- name of registered block model
- Returns:
- new model instance or null if program is not open.
- Throws:
- NotFoundException- if specified model is not registered
 
 - 
getNewModelByName@Deprecated CodeBlockModel getNewModelByName(java.lang.String modelName, boolean includeExternals) throws NotFoundException Deprecated.use getNewModelByName(String, Program, boolean) insteadGet new instance of the specified block model.- Parameters:
- modelName- name of registered block model
- includeExternals- externals are included if true
- Returns:
- new model instance or null if program is not open.
- Throws:
- NotFoundException- if specified model is not registered
 
 - 
getNewModelByNameCodeBlockModel getNewModelByName(java.lang.String modelName, Program program) throws NotFoundException Get new instance of the specified block model.- Parameters:
- modelName- name of registered block model
- program- program associated with the model
- Returns:
- new model instance or null if program is null
- Throws:
- NotFoundException- if specified model is not registered
 
 - 
getNewModelByNameCodeBlockModel getNewModelByName(java.lang.String modelName, Program program, boolean includeExternals) throws NotFoundException Get new instance of the specified block model.- Parameters:
- modelName- name of registered block model
- program- program associated with the model
- includeExternals- externals are included if true
- Returns:
- new model instance or null if program is null
- Throws:
- NotFoundException- if specified model is not registered
 
 - 
getAvailableModelNamesjava.lang.String[] getAvailableModelNames(int modelType) Get list of registered block models of the specified type. A modelType of ANY_BLOCK will return all models registered. List ordering is based upon the registration order. It is important to recognize that the list of returned names could change as models are registered and unregistered.- Parameters:
- modelType- type of model (ANY_MODEL, BASIC_MODEL or SUBROUTINE_MODEL)
- Returns:
- array of model names
 
 - 
addListenervoid addListener(BlockModelServiceListener listener) Add service listener.- Parameters:
- listener- listener to add
 
 - 
removeListenervoid removeListener(BlockModelServiceListener listener) Remove service listener.- Parameters:
- listener- to remove
 
 
- 
 
-