# Class: com.pnfsoftware.jeb.core.units.AbstractUnitIdentifier

Skeleton implementation for an [IUnitIdentifier](IUnitIdentifier) class \(aka, a Parser\). It is recommended parsers extend this class \(or one of the its many subclasses\) instead of implementing IUnitIdentifier.

## Constructor: AbstractUnitIdentifier
- parameter: `type`, type: `java.lang.String`
- parameter: `priority`, type: `double`

Description: Create a new unit identifier.
parameter: type: mandatory type, which will be used as the sub\-region type when the identifier is            [initialized](AbstractUnitIdentifier#initialize(IPropertyDefinitionManager)).            The type should be a valid region name, please see            [PropertyDefinitionManager](PropertyDefinitionManager)
parameter: priority: mandatory priority

## Protected Field: pdm
Type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`

## Protected Field: pm
Type: `com.pnfsoftware.jeb.core.properties.IPropertyManager`

## Protected Field: priority
Type: `double`

## Protected Field: type
Type: `java.lang.String`

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

Description: The default implementation returns false.

## Protected Method: createPDM
- parameter: `parentPdm`, type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`
- parameter: `pdmDescription`, type: `java.lang.String`
- parameter: `pdmFlags`, type: `int`


## Method: getFormatType
- return type: `java.lang.String`


## Method: getPriority
- return type: `double`


## Method: getPropertyDefinitionManager
- return type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`


## Method: getTypeIdProvider
- return type: `com.pnfsoftware.jeb.util.serialization.ITypeIdProvider`


## Method: initialize
- parameter: `parentPdm`, type: `com.pnfsoftware.jeb.core.properties.IPropertyDefinitionManager`

Description: The default implementation creates a basic PDM attached to the provided parent.

## Static Method: checkBytes
- parameter: `data`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `marker`, type: `byte[]`
- return type: `boolean`

Description: 
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean, byte...)

## Static Method: checkBytes
- parameter: `data`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `caseSensitive`, type: `boolean`
- parameter: `marker`, type: `byte[]`
- return type: `boolean`

Description: Convenience method used to check for expected bytes at a specific offset within the provided data buffer.
parameter: data: the input data buffer
parameter: offset: the offset
parameter: caseSensitive: indicate if \[a\-z\] should be considered as case sensitive. While            insensitive case, marker must receive lower case characters. Default value is            TRUE.
parameter: marker: the bytes to check for
return: true if the bytes at &data\[offset\] are equals to the provided bytes

## Static Method: checkBytes
- parameter: `data`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `marker`, type: `int[]`
- return type: `boolean`

Description: 
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean ,byte...)

## Static Method: checkBytes
- parameter: `data`, type: `byte[]`
- parameter: `offset`, type: `int`
- parameter: `caseSensitive`, type: `boolean`
- parameter: `marker`, type: `int[]`
- return type: `boolean`

Description: 
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean ,byte...)

## Static Method: checkBytes
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `offset`, type: `int`
- parameter: `marker`, type: `byte[]`
- return type: `boolean`

Description: 
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean, byte...)

## Static Method: checkBytes
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `offset`, type: `int`
- parameter: `marker`, type: `int[]`
- return type: `boolean`

Description: 
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean, byte...)

## Static Method: checkBytes
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `offset`, type: `int`
- parameter: `header`, type: `java.lang.String`
- return type: `boolean`

Description: 
parameter: header: converted to byte\[\] using [Strings#encodeUTF8(String)](Strings#encodeUTF8(String))
see also: AbstractUnitIdentifier#checkBytes(byte[], int, boolean, byte...)

## Static Method: getNonWhitespaceHeader
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `size`, type: `int`
- parameter: `extraWhitespaceCharacters`, type: `char[]`
- return type: `byte[]`

Description: Returns the header with at least n significant bytes after the initial whitespace. To be used for text documents which can potentially contain lot of whitespace characters before text. May return trimmed data \(when header is not enough\) or non\-trimmed data \(when header is enough\).
parameter: input: 
parameter: size: 
parameter: extraWhitespaceCharacters: 
return: 

## Static Method: getNonWhitespaceHeader
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `size`, type: `int`
- parameter: `trim`, type: `boolean`
- parameter: `extraWhitespaceCharacters`, type: `char[]`
- return type: `byte[]`

Description: Returns the header with at least n significant bytes after the initial whitespace. To be used for text documents which can potentially contain lot of whitespace characters before text.
parameter: input: [IInput](IInput)
parameter: size: minimum data size required
parameter: trim: when true, any BOM \+ any whitespace will be skipped
parameter: extraWhitespaceCharacters: additional characters considered as whitespace
return: an array with at least minimum size. If there is not enough available bytes, the         array size will be smaller. May return null in case of error or when file only         contains whitespaces.

## Protected Static Method: getTextFirstIndex
- parameter: `data`, type: `byte[]`
- parameter: `i`, type: `int`
- parameter: `extraWhitespaceCharacters`, type: `char[]`
- return type: `int`


## Static Method: readHeaderByte
- parameter: `input`, type: `com.pnfsoftware.jeb.core.input.IInput`
- parameter: `offset`, type: `int`
- return type: `int`

Description: Read a single header byte.
parameter: input: 
parameter: offset: offset within the [IInput#getHeader()](IInput#getHeader())
return: the byte value, \-1 on error \(eg, the offset is outside the header\)

