# Interface: com.pnfsoftware.jeb.core.units.IUnitIdentifier

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](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](IUnitProcessor).

## Static Field: KEY_FAILURE_REASON
Type: `java.lang.String`

Constant value: `FAILURE_REASON`
Description: Identification map key for an optional failure reason.

## Method: acceptAnyInputBytes
- return type: `boolean`

Description: Indicate that this identifier could return true for any input. The input data does not follow a specific format.
return: true if the input data may not be readily identified as of a specific format

## Method: canIdentify
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.IUnitCreator`
- parameter: `name`, type: `java.lang.String`
- parameter: `identmap`, type: `java.util.Map<java.lang.Object,java.lang.Object>`
- return type: `boolean`

Description: Perform input identification. Determine if a corresponding unit may be created out of the provided input.
parameter: input: input data, may be null only if the parent is not null
parameter: parent: the parent
parameter: name: optional input name
parameter: identmap: optional output map filled during identification; on success, that object            should be provided to            [prepare](#prepare(String, IInput, IUnitProcessor, IUnitCreator, Map)).
            List of special keys that may be filled during identification regardless of            success/failure:
            \- `"FAILURE_REASON"` \(type String\): upon failure, an optional message \(type            String\) provided by the identifier to the client explaining why identification            failed, if the reason is potentially interesting to the client
return: true if the identification succeeded, false otherwise. Users will want to call         prepare\(\) upon successful identification, although identification may be bypassed

## Method: canIdentify
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.IUnitCreator`
- return type: `boolean`

Description: Legacy method that does not provide name and identmap.
parameter: input: input data, may be null only if the parent is not null
parameter: parent: parent unit or artifact
return: true if the identification succeeded

## Method: prepare
- parameter: `name`, type: `java.lang.String`
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `unitProcessor`, type: `com.pnfsoftware.jeb.core.units.IUnitProcessor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.IUnitCreator`
- parameter: `identmap`, type: `java.util.Map<java.lang.Object,java.lang.Object>`
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: 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](IUnit#process()) 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.
parameter: name: the unit name
parameter: input: the input binary data for that unit
parameter: unitProcessor: the processor
parameter: parent: the parent
parameter: identmap: optional identification map filled out by            [#canIdentify(IInput, IUnitCreator, String, Map)](#canIdentify(IInput, IUnitCreator, String, Map))
return: a fresh unit that can process \`data\`

## Method: prepare
- parameter: `name`, type: `java.lang.String`
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `unitProcessor`, type: `com.pnfsoftware.jeb.core.units.IUnitProcessor`
- parameter: `parent`, type: `com.pnfsoftware.jeb.core.IUnitCreator`
- return type: `com.pnfsoftware.jeb.core.units.IUnit`

Description: Legacy method that does not provide identmap.
parameter: name: the unit name
parameter: input: the input binary data for that unit
parameter: unitProcessor: the processor
parameter: parent: the parent
return: a fresh unit, or null if preparation failed

