public interface

IUnitIdentifier

implements IPlugin
com.pnfsoftware.jeb.core.units.IUnitIdentifier
Known Indirect Subclasses

Class Overview

Unit identifiers are one of the two types of plugins supported by JEB engines. They are used to determine if some input data can be processed by a corresponding unit. Unit plugins must have a public no-argument constructor. Currently, unit plugins cannot be unloaded (and therefore, unlike IEnginesPlugin, do not offer a dispose() method).

Identifiers have a unique type identification string (eg, "dex") and a priority. For identifiers that successfully identify the same input data as processable, the tie can be broken by using the priority value.

Identifiers build (or rebuild) units and provide them to clients.

Identifiers are rarely used on their own. They are generally managed by a IUnitProcessor.

Summary

Public Methods
abstract boolean canIdentify(IInput input, IUnitCreator parent)
Perform input identification.
abstract String getFormatType()
Retrieve the identity of the unit type.
abstract double getPriority()
Get the identifier priority.
abstract IPropertyDefinitionManager getPropertyDefinitionManager()
Retrieve the property definition manager used by the identifier.
abstract ITypeIdProvider getTypeIdProvider()
The type-id provider for this type of units.
abstract void initialize(IPropertyDefinitionManager parent)
Initialize the property manager for this identifier.
abstract IUnit prepare(String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent)
This method is used to produce a unit of the corresponding identifier type.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.IPlugin

Public Methods

public abstract boolean canIdentify (IInput input, IUnitCreator parent)

Perform input identification. Determine if a corresponding unit may be created out of the provided input.

Parameters
input input data, may be null only if the parent is not null
parent the parent
Returns
  • true if the identification succeeded, false otherwise. Users typically call prepare on successful identification, although identification may be bypassed

public abstract String getFormatType ()

Retrieve the identity of the unit type. The type should be unique across all units.

Returns
  • the non-null type

public abstract double getPriority ()

Get the identifier priority. Priority can be negative. Priorities are used by identifier managers (eg, Processors) to ensure that identifiers are called in a (partially) predictable order, if need be. The higher the number, the higher the priority.

Recommendation: typical priority is zero. Relying on priority for proper identification should be used as a last resort measure.

Returns
  • the identifier priority

public abstract IPropertyDefinitionManager getPropertyDefinitionManager ()

Retrieve the property definition manager used by the identifier.

Returns
  • the PDM

public abstract ITypeIdProvider getTypeIdProvider ()

The type-id provider for this type of units. Currently, This method is not intended to use by third-party clients.

Returns
  • a type-id provider, null if none

public abstract void initialize (IPropertyDefinitionManager parent)

Initialize the property manager for this identifier. This method is usually called after construction on the identifier.

Overrides are allowed if a plugin needs to define its own properties, but a call to the superclass method should take place first.

Parameters
parent the parent PDM

public abstract IUnit prepare (String name, IInput input, IUnitProcessor unitProcessor, IUnitCreator parent)

This method is used to produce a unit of the corresponding identifier type. Typically, it is called by unit processors when input data has been identified by the unit identifier as a potential candidate for the corresponding unit.

Unit preparation may involve processing the unit. Starting with JEB 2.2, we recommend that unit processing be left at the discretion of client code. Lazy processing may avoid incurring unnecessary or untimely computational overheads.

Parameters
name the unit name
input the input binary data for that unit
unitProcessor the processor
parent the parent
Returns
  • a fresh unit that can process `data`