Package com.pnfsoftware.jeb.core.units
Interface IAddressableUnit
- All Superinterfaces:
IEventSource
,IUnit
,IUnitCreator
,IUserDataSupport
- All Known Subinterfaces:
ICodeUnit
,IDalvikDebuggerUnit
,IDebuggerUnit
,IDecompilerUnit
,IDexDecompilerUnit
,IDexUnit
,IInteractiveUnit
,IJavaSourceUnit
,INativeCodeUnit<InsnType>
,INativeDebuggerUnit
,INativeDecompilerUnit<InsnType>
,INativeSourceUnit
,ISourceUnit
,IXmlUnit
- All Known Implementing Classes:
AbstractCodeUnit
,AbstractInteractiveBinaryUnit
,AbstractInteractiveUnit
,InteractiveWrapperUnit
Addressable units allow the retrieval of unit objects via object identifiers and addresses.
-
Method Summary
Modifier and TypeMethodDescriptiondefault String
getAddressLabel
(String address) Retrieve the label at a given address.Retrieve all labels.getAddressOfItem
(long id) Attempt to determine the best address for a given item.default String
getCanonicalAddress
(String address) Convert the provided address to its canonical form.long
getItemAtAddress
(String address) Attempt to determine the best item for a given address.getItemObject
(long id) Optionally provide an object associated with the given item.getRelatedItems
(long id) Retrieve items related to the provided item id.default Collection<String>
getWellKnownAddresses
(int maxCount, Predicate<String> validator) Retrieve a collection of valid unit addresses.boolean
isValidAddress
(String address) Determine if the provided address is a valid address for this unit.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.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
-
getItemObject
Optionally provide an object associated with the given item. This method may return null, an opaque object, or an object defined by the contract of the implementing object or sub-interface. The SPI of sub-interfaces should specify the item id formats, if any, as well as types and semantics associated with the objects returned by this method.- Parameters:
id
- the item id- Returns:
- an object, whose type is defined by contract, potentially null
-
isValidAddress
Determine if the provided address is a valid address for this unit.- Parameters:
address
-- Returns:
-
getCanonicalAddress
Convert the provided address to its canonical form. If the canonical form cannot be determined, the method is allowed to return the provided address.- Parameters:
address
-- Returns:
-
getAddressOfItem
Attempt to determine the best address for a given item. Implementors may return null if a conversion is deemed impossible, inaccurate or irrelevant.Clients use this method to provide navigation capability, for example, jumping from an item to the master (main) related item, that would be located at the resulting address.
Plugin developers are recommended to implement this method.
- Parameters:
id
- the item id- Returns:
- an address best representing or matching the provided item, null otherwise
-
getRelatedItems
Retrieve items related to the provided item id. The definition and context of 'relation' is implementation dependent.- Parameters:
id
- an item id- Returns:
- a list of related items (not containing the provided id), may be empty - never null
-
getItemAtAddress
Attempt to determine the best item for a given address. Implementors may return 0 if a conversion is deemed impossible, inaccurate or irrelevant.- Parameters:
address
- the address- Returns:
- an item best representing or matching the provided address, 0 otherwise
-
getAddressLabels
Retrieve all labels. The default implementation returns an empty map.- Returns:
- a map of "address: label" value pairs
-
getAddressLabel
Retrieve the label at a given address. The default implementation returns null.- Parameters:
address
- mandatory address- Returns:
- the label, null if none
-
getWellKnownAddresses
Retrieve a collection of valid unit addresses.- Parameters:
maxCount
- optional maximum count of entries to return; use -1 to remove the capvalidator
- optional validator; only addresses that pass the test will be retrieved- Returns:
-