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.getPackage(String fqname) Convenience method used to retrieve a package by name.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, isValidAddressMethods inherited from interface com.pnfsoftware.jeb.util.events.IEventSource
addListener, countListeners, getListeners, getParentSource, insertListener, notifyListeners, removeListener, setParentSourceMethods inherited from interface com.pnfsoftware.jeb.core.units.IInteractiveUnit
addressToLocation, canExecuteAction, executeAction, executeAction, getAddressActions, getFullComment, getFullComments, getGlobalActions, getInlineComment, getInlineComments, getItemActions, getMetadataManager, locationToAddress, prepareExecution, setInlineCommentMethods inherited from interface com.pnfsoftware.jeb.core.units.IUnit
addChild, addChild, canBePersisted, dispose, execprvfunc, 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, setUnitProcessorMethods inherited from interface com.pnfsoftware.jeb.core.IUserDataSupport
clearAllData, getAllData, getData, setData
-
Method Details
-
getHierarchy
ICodeHierarchy getHierarchy()Get the code hierarchy.- Returns:
- code hierarchy
-
getStrings
List<? extends ICodeString> getStrings()Get the list of code strings.- Returns:
- code strings
-
getPackages
List<? extends ICodePackage> getPackages()Get the list of code packages.- Returns:
- code packages
-
getTypes
Get the list of types.- Returns:
- code types
-
getClasses
List<? extends ICodeClass> getClasses()Get the list of classes.- Returns:
- code classes
-
getFields
List<? extends ICodeField> getFields()Get the list of fields.- Returns:
- code fields
-
getMethods
List<? extends ICodeMethod> getMethods()Get the list of methods.- Returns:
- code methods
-
getClass
Convenience method used to retrieve a class by name.- Parameters:
fqname- fully-qualified class name- Returns:
- matching class, or null
-
getField
Convenience method used to retrieve a field by name.- Parameters:
fqname- fully-qualified field name- Returns:
- matching field, or null
-
getMethod
Convenience method used to retrieve a method by name.- Parameters:
fqname- fully-qualified method name- Returns:
- matching method, or null
-
getPackage
Convenience method used to retrieve a package by name.- Parameters:
fqname- fully-qualified package name- Returns:
- matching package, or null
-
getCodeItemByAddress
Convenience method used to retrieve a code item by name.- Parameters:
fqname- fully-qualified item name- Returns:
- a class, method field or other item
-
getCodeCoordinatesFromAddress
Convert a unit address to code coordinates.- Parameters:
address- unit address- Returns:
- code coordinates, or null
-
getAddressFromCodeCoordinates
Convert code coordinates to a unit address.- Parameters:
cc- code coordinates- Returns:
- unit address, or null
-
getCommentManager
CodeCommentManager<?> getCommentManager()Description copied from interface:IInteractiveUnitGet the comment manager. This method is optional. When the unit is disposed, this method must return null. The default implementation returns null.- Specified by:
getCommentManagerin 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:
- disassembly document
-
getDisassembly
String getDisassembly()Convenience method used to generate the disassembly of this code unit using standard settings.- Returns:
- disassembly text
-