Interface ICodeUnit
- All Superinterfaces:
IAddressableUnit
,IEventSource
,IInteractiveUnit
,IUnit
,IUnitCreator
,IUserDataSupport
- All Known Subinterfaces:
IDexUnit
,INativeCodeUnit<InsnType>
- All Known Implementing Classes:
AbstractCodeUnit
Base interface for units representing disassembled binary code, such as bytecode, opcodes, object
files, executable files, and so on.
Code units are interactive, in order to provide facility for code refactoring, modification, etc.
Code units generate CodeDocument
, and as such, generate AssemblyItem
objects.
Implementors must implement IAddressableUnit.getItemObject(long)
properly.
-
Method Summary
Modifier and TypeMethodDescriptionConvert code coordinates to a unit address.Convenience method used to retrieve a class by name.List<? extends ICodeClass>
Get the list of classes.getCodeCoordinatesFromAddress
(String address) Convert a unit address to code coordinates.getCodeItemByAddress
(String fqname) Convenience method used to retrieve a code item by name.Get the comment manager.Convenience method used to generate the disassembly of this code unit using standard settings.Convenience method to retrieve the text document representing the disassembly of this code unit.Convenience method used to retrieve a field by name.List<? extends ICodeField>
Get the list of fields.Get the code hierarchy.Convenience method used to retrieve a method by name.List<? extends ICodeMethod>
Get the list of methods.List<? extends ICodePackage>
Get the list of code packages.List<? extends ICodeString>
Get the list of code strings.getTypes()
Get the list of types.Methods inherited from interface com.pnfsoftware.jeb.core.units.IAddressableUnit
getAddressLabel, getAddressLabels, getAddressOfItem, getCanonicalAddress, getItemAtAddress, getItemObject, getRelatedItems, getWellKnownAddresses, isValidAddress
Methods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSource
Methods inherited from interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
addressToLocation, canExecuteAction, executeAction, executeAction, getAddressActions, getFullComment, getFullComments, getGlobalActions, getInlineComment, getInlineComments, getItemActions, getMetadataManager, locationToAddress, prepareExecution, setInlineComment
Methods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, generateQuickState, getChildren, getContributions, getCreationTimestamp, getDescription, getExtraInputs, getFormatter, getFormatType, getIconData, getInput, getInterpreters, getLock, getName, getNotes, getNotificationManager, getParent, getParentArtifact, getParentProject, getPropertyDefinitionManager, getPropertyManager, getRealName, getStatus, getUid, getUnitProcessor, initializePropertyObjects, isDisposed, isProcessed, isStale, isTransientChild, notifyGenericChange, postDeserialization, process, removeChild, setName, setNotes, setParent, setRealName, setUnitProcessor
Methods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Method Details
-
getHierarchy
ICodeHierarchy getHierarchy()Get the code hierarchy.- Returns:
-
getStrings
List<? extends ICodeString> getStrings()Get the list of code strings.- Returns:
-
getPackages
List<? extends ICodePackage> getPackages()Get the list of code packages.- Returns:
-
getTypes
Get the list of types.- Returns:
-
getClasses
List<? extends ICodeClass> getClasses()Get the list of classes.- Returns:
-
getFields
List<? extends ICodeField> getFields()Get the list of fields.- Returns:
-
getMethods
List<? extends ICodeMethod> getMethods()Get the list of methods.- Returns:
-
getClass
Convenience method used to retrieve a class by name.- Parameters:
fqname
-- Returns:
-
getField
Convenience method used to retrieve a field by name.- Parameters:
fqname
-- Returns:
-
getMethod
Convenience method used to retrieve a method by name.- Parameters:
fqname
-- Returns:
-
getCodeItemByAddress
Convenience method used to retrieve a code item by name.- Parameters:
fqname
-- Returns:
- a class, method field or other item
-
getCodeCoordinatesFromAddress
Convert a unit address to code coordinates.- Parameters:
address
-- Returns:
-
getAddressFromCodeCoordinates
Convert code coordinates to a unit address.- Parameters:
cc
-- Returns:
-
getCommentManager
CodeCommentManager<?> getCommentManager()Description copied from interface:IInteractiveUnit
Get the comment manager. This method is optional. When the unit is disposed, this method must return null. The default implementation returns null.- Specified by:
getCommentManager
in interfaceIInteractiveUnit
- Returns:
- a comment manager, or null if the unit does not have one
-
getDisassemblyDocument
ITextDocument getDisassemblyDocument()Convenience method to retrieve the text document representing the disassembly of this code unit.The caller is responsible for disposing the returned document after usage.
- Returns:
-
getDisassembly
String getDisassembly()Convenience method used to generate the disassembly of this code unit using standard settings.- Returns:
-