Class EidModelHelper

java.lang.Object
be.gaudry.model.eid.EidModelHelper

public class EidModelHelper extends Object
Provides a set of static methods on VirtualBeID and BeIDPerson objects. \n\nHow to solve access restriction in eclipse \nTwo possible ways:
  • Windows -> Preferences -> Java -> Compiler -> Errors/Warnings
  • (Project) Properties -> Java Compiler -> Errors/Warnings

Locate the "Forbidden reference (access rules)" option under "Deprecated and restricted API" section in the dialog box. \nThis option decides how to handle access rules defined inside Eclipse. \nBy default it is set to "Error" which causes Eclipse to complain about references to any restricted classes. \nChoosing any other option (Warning or Ignore) will remove these error messages

Since:
1.0 Jun 18, 2009, 1.0
Version:
%I%, %G%
Author:
Steph GAUDRY
  • Field Details

  • Method Details

    • getPerson

      public static Person getPerson(be.belgium.eid.objects.IDData idData)
    • idData2Person

      public static boolean idData2Person(be.belgium.eid.objects.IDData idData, Person person)
    • setIdAddress

      public static boolean setIdAddress(be.belgium.eid.objects.IDAddress idAddress, Address address)
    • isReaderAvailable

      public static boolean isReaderAvailable() throws BrolEidException
      Throws:
      BrolEidException
    • isCardAvailable

      public static boolean isCardAvailable() throws BrolEidException
      Throws:
      BrolEidException
    • printEidPanel

      public static int printEidPanel(Graphics graphics, PageFormat pageFormat, int pageIndex, VirtualBeID virtualBeID) throws PrinterException
      Prints the page at the specified index into the specified Graphics context in the specified format. A PrinterJob calls the Printable interface to request that a page be rendered into the context specified by graphics. The format of the page to be drawn is specified by pageFormat. The zero based index of the requested page is specified by pageIndex. If the requested page does not exist then this method returns NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned. The Graphics class or subclass implements the PrinterGraphics interface to provide additional information. If the Printable object aborts the print job then it throws a PrinterException.
      Parameters:
      graphics - the context into which the page is drawn
      pageFormat - the size and orientation of the page being drawn
      pageIndex - the zero based index of the page to be drawn
      virtualBeID - Contains the BeID card informations
      Returns:
      PAGE_EXISTS if the page is rendered successfully or NO_SUCH_PAGE if pageIndex specifies a non-existent page.
      Throws:
      PrinterException - thrown when the print job is terminated.
      Since:
      1.0
      See Also:
      Printable.print(java.awt.Graphics, java.awt.print.PageFormat, int)
    • decodeImage

      public static BufferedImage decodeImage(byte[] photoData)
    • encodeImage

      public static byte[] encodeImage(Image image)
    • decodePhotoBytes

      public static byte[] decodePhotoBytes(String encoded)
    • getB64Encoder

      public static Base64.Encoder getB64Encoder()
      Returns:
    • saveBeID

      public static void saveBeID(File file, VirtualBeID virtualBeID) throws IOException
      Exports the virtual BEID to the given XML-file.
      Parameters:
      file - Where to save the informations
      virtualBeID -
      Throws:
      IOException
    • loadOriginalFile

      public static VirtualBeID loadOriginalFile(File file) throws ParseException, org.dom4j.DocumentException
      Loads data from the given file to initialize the VirtualBeID.
      Parameters:
      file - is the file to read
      Returns:
      a VirtualBeID object containing all the BeID card data
      Throws:
      ParseException - when the dates couldn't be parsed correctly
      org.dom4j.DocumentException - when the document isn't well-formed
    • load

      public static VirtualBeID load(File file) throws ParseException, org.dom4j.DocumentException
      Loads data from the given file to initialize the VirtualBeID.
      Parameters:
      file - is the file to read
      Returns:
      a VirtualBeID object containing all the BeID card data
      Throws:
      ParseException - when the dates couldn't be parsed correctly
      org.dom4j.DocumentException - when the document isn't well-formed
    • person2IDData

      public static be.belgium.eid.objects.IDData person2IDData(Person person)
    • address2IDAddress

      public static be.belgium.eid.objects.IDAddress address2IDAddress(Address address)
    • person2Virtual

      public static VirtualBeID person2Virtual(PersonExt person)
    • virtual2PersonExt

      public static void virtual2PersonExt(VirtualBeID virtual, PersonExt person)
      Parameters:
      virtual -
      person -
      Throws:
      UncompleteSettingException - if at least a property has not been set
      NullPointerException - if a parameter is null
    • geMRZ

      public static String geMRZ(be.belgium.eid.objects.IDData beIDData)
      Builds the characters sequence in the EID back side
      Returns:
    • debug

      public static String debug(be.belgium.eid.objects.IDVersion beIDVersionInfo)
    • debug

      public static String debug(be.belgium.eid.objects.IDPhoto beIDPhoto)
    • debug

      public static String debug(be.belgium.eid.security.CertificateChain beIDCertificateChain)
    • debug

      public static String debug(be.belgium.eid.objects.IDAddress beIDAddress)
    • debug

      public static String debug(be.belgium.eid.objects.IDData beIDData)