Module com.machinezoo.fingerprintio
Class Iso19794p1v2011Template
- java.lang.Object
-
- com.machinezoo.fingerprintio.iso19794p1v2011.Iso19794p1v2011Template
-
public class Iso19794p1v2011Template extends Object
ISO/IEC 19794-1:2011 base template.- See Also:
- ISO/IEC 19794-1:2011 Summary
-
-
Field Summary
Fields Modifier and Type Field Description byte[]
extra
Format-specific template header fields.Iso19794p1v2011Modality
modality
File signature / magic number (MAGIC).List<Iso19794p1v2011Sample>
samples
List of biometric samples (SAMPLE).int
versionMajor
Format version / major (VERSION).int
versionMinor
Format version / minor (VERSION).
-
Constructor Summary
Constructors Constructor Description Iso19794p1v2011Template()
Creates new ISO/IEC 19794-1:2011 template.Iso19794p1v2011Template(byte[] template, boolean strict, Iso19794p1v2011Format format)
Deprecated.Iso19794p1v2011Template(byte[] template, Iso19794p1v2011Format format)
Parses and validates ISO/IEC 19794-1:2011 template.Iso19794p1v2011Template(byte[] template, ExceptionHandler handler, Iso19794p1v2011Format format)
Parses and optionally validates ISO/IEC 19794-1:2011 template.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
accepts(byte[] template)
Checks whether provided template is an instance of ISO/IEC 19794-1:2011 base template.byte[]
toByteArray(Iso19794p1v2011Format format)
Validates and serializes the template in ISO/IEC 19794-1:2011 format.
-
-
-
Field Detail
-
modality
public Iso19794p1v2011Modality modality
File signature / magic number (MAGIC).
-
versionMajor
public int versionMajor
Format version / major (VERSION). Major version number is stored in the first two bytes of the VERSION field. Defaults to 3.
-
versionMinor
public int versionMinor
Format version / minor (VERSION). Minor version number is stored in the third byte of the VERSION field. Defaults to 0.
-
extra
public byte[] extra
Format-specific template header fields.
-
samples
public List<Iso19794p1v2011Sample> samples
List of biometric samples (SAMPLE).
-
-
Constructor Detail
-
Iso19794p1v2011Template
public Iso19794p1v2011Template()
Creates new ISO/IEC 19794-1:2011 template.
-
Iso19794p1v2011Template
public Iso19794p1v2011Template(byte[] template, Iso19794p1v2011Format format)
Parses and validates ISO/IEC 19794-1:2011 template.- Parameters:
-
template
- serialized template in ISO/IEC 19794-1:2011 format -
format
- information about optional fields - Throws:
-
TemplateFormatException
- if the template cannot be parsed or it fails validation
-
Iso19794p1v2011Template
@Deprecated public Iso19794p1v2011Template(byte[] template, boolean strict, Iso19794p1v2011Format format)
Deprecated.Parses and optionally validates ISO/IEC 19794-1:2011 template.- Parameters:
-
template
- serialized template in ISO/IEC 19794-1:2011 format -
strict
-true
to validate the template,false
to tolerate parsing errors as much as possible -
format
- information about optional fields - Throws:
-
TemplateFormatException
- if the template cannot be parsed or ifstrict
istrue
and the template fails validation
-
Iso19794p1v2011Template
public Iso19794p1v2011Template(byte[] template, ExceptionHandler handler, Iso19794p1v2011Format format)
Parses and optionally validates ISO/IEC 19794-1:2011 template.Recoverable validation exceptions encountered during parsing will be fed to the provided exception handler. Pass in
Exceptions.silence()
to ignore all recoverable validation errors orExceptions.propagate()
to throw exception even for recoverable errors.- Parameters:
-
template
- serialized template in ISO/IEC 19794-1:2011 format -
handler
- handler for recoverable validation exceptions -
format
- information about optional fields - Throws:
-
TemplateFormatException
- if unrecoverable validation error is encountered or the provided exception handler returnsfalse
-
-
Method Detail
-
accepts
public static boolean accepts(byte[] template)
Checks whether provided template is an instance of ISO/IEC 19794-1:2011 base template. This method does not do any template validation or conformance checking. It just differentiates ISO/IEC 19794-1:2011 from other template formats as quickly as possible, mostly by looking at template header.- Parameters:
-
template
- serialized template that is to be evaluated - Returns:
-
true
iftemplate
is an instance of ISO/IEC 19794-1:2011 base template,false
otherwise
-
toByteArray
public byte[] toByteArray(Iso19794p1v2011Format format)
Validates and serializes the template in ISO/IEC 19794-1:2011 format.- Parameters:
-
format
- information about optional fields - Returns:
- serialized template in ISO/IEC 19794-1:2011 format
- Throws:
-
TemplateFormatException
- if the template fails validation
-
-