Interface ICodeUnit

All Superinterfaces:
IAddressableUnit, IEventSource, IInteractiveUnit, IUnit, IUnitCreator, IUserDataSupport
All Known Subinterfaces:
IDexUnit, INativeCodeUnit<InsnType>
All Known Implementing Classes:
AbstractCodeUnit

@Ser public interface ICodeUnit extends IInteractiveUnit
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 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

      List<? extends ICodeType> 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

      ICodeClass getClass(String fqname)
      Convenience method used to retrieve a class by name.
      Parameters:
      fqname -
      Returns:
    • getField

      ICodeField getField(String fqname)
      Convenience method used to retrieve a field by name.
      Parameters:
      fqname -
      Returns:
    • getMethod

      ICodeMethod getMethod(String fqname)
      Convenience method used to retrieve a method by name.
      Parameters:
      fqname -
      Returns:
    • getCodeItemByAddress

      ICodeItem getCodeItemByAddress(String fqname)
      Convenience method used to retrieve a code item by name.
      Parameters:
      fqname -
      Returns:
      a class, method field or other item
    • getCodeCoordinatesFromAddress

      ICodeCoordinates getCodeCoordinatesFromAddress(String address)
      Convert a unit address to code coordinates.
      Parameters:
      address -
      Returns:
    • getAddressFromCodeCoordinates

      String getAddressFromCodeCoordinates(ICodeCoordinates cc)
      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 interface IInteractiveUnit
      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: