Class Iso19794p1v2011Template

    • Field Detail

      • 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.
    • 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

        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 or Exceptions.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 returns false
    • 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 if template 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