Package be.gaudry.model.eid
Class EidModelHelper
java.lang.Object
be.gaudry.model.eid.EidModelHelper
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic be.belgium.eid.objects.IDAddressaddress2IDAddress(Address address)static Stringdebug(be.belgium.eid.objects.IDAddress beIDAddress)static Stringdebug(be.belgium.eid.objects.IDData beIDData)static Stringdebug(be.belgium.eid.objects.IDPhoto beIDPhoto)static Stringdebug(be.belgium.eid.objects.IDVersion beIDVersionInfo)static Stringdebug(be.belgium.eid.security.CertificateChain beIDCertificateChain)static BufferedImagedecodeImage(byte[] photoData)static byte[]decodePhotoBytes(String encoded)static byte[]encodeImage(Image image)static StringgeMRZ(be.belgium.eid.objects.IDData beIDData)Builds the characters sequence in the EID back sidestatic Base64.Encoderstatic PersongetPerson(be.belgium.eid.objects.IDData idData)static booleanidData2Person(be.belgium.eid.objects.IDData idData, Person person)static booleanstatic booleanstatic VirtualBeIDLoads data from the given file to initialize theVirtualBeID.static VirtualBeIDloadOriginalFile(File file)Loads data from the given file to initialize theVirtualBeID.static be.belgium.eid.objects.IDDataperson2IDData(Person person)static VirtualBeIDperson2Virtual(PersonExt person)static intprintEidPanel(Graphics graphics, PageFormat pageFormat, int pageIndex, VirtualBeID virtualBeID)Prints the page at the specified index into the specifiedGraphicscontext in the specified format.static voidsaveBeID(File file, VirtualBeID virtualBeID)Exports the virtual BEID to the given XML-file.static booleansetIdAddress(be.belgium.eid.objects.IDAddress idAddress, Address address)static voidvirtual2PersonExt(VirtualBeID virtual, PersonExt person)
-
Field Details
-
DEBUG_ENABLED
public static final boolean DEBUG_ENABLED- See Also:
- Constant Field Values
-
-
Method Details
-
getPerson
-
idData2Person
-
setIdAddress
-
isReaderAvailable
- Throws:
BrolEidException
-
isCardAvailable
- Throws:
BrolEidException
-
printEidPanel
public static int printEidPanel(Graphics graphics, PageFormat pageFormat, int pageIndex, VirtualBeID virtualBeID) throws PrinterExceptionPrints the page at the specified index into the specifiedGraphicscontext in the specified format. APrinterJobcalls thePrintableinterface to request that a page be rendered into the context specified bygraphics. The format of the page to be drawn is specified bypageFormat. The zero based index of the requested page is specified bypageIndex. If the requested page does not exist then this method returns NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned. TheGraphicsclass or subclass implements thePrinterGraphicsinterface to provide additional information. If thePrintableobject aborts the print job then it throws aPrinterException.- Parameters:
graphics- the context into which the page is drawnpageFormat- the size and orientation of the page being drawnpageIndex- the zero based index of the page to be drawnvirtualBeID- Contains the BeID card informations- Returns:
- PAGE_EXISTS if the page is rendered successfully
or NO_SUCH_PAGE if
pageIndexspecifies 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
-
encodeImage
-
decodePhotoBytes
-
getB64Encoder
- Returns:
-
saveBeID
Exports the virtual BEID to the given XML-file.- Parameters:
file- Where to save the informationsvirtualBeID-- Throws:
IOException
-
loadOriginalFile
public static VirtualBeID loadOriginalFile(File file) throws ParseException, org.dom4j.DocumentExceptionLoads data from the given file to initialize theVirtualBeID.- Parameters:
file- is the file to read- Returns:
- a
VirtualBeIDobject containing all the BeID card data - Throws:
ParseException- when the dates couldn't be parsed correctlyorg.dom4j.DocumentException- when the document isn't well-formed
-
load
Loads data from the given file to initialize theVirtualBeID.- Parameters:
file- is the file to read- Returns:
- a
VirtualBeIDobject containing all the BeID card data - Throws:
ParseException- when the dates couldn't be parsed correctlyorg.dom4j.DocumentException- when the document isn't well-formed
-
person2IDData
-
address2IDAddress
-
person2Virtual
-
virtual2PersonExt
- Parameters:
virtual-person-- Throws:
UncompleteSettingException- if at least a property has not been setNullPointerException- if a parameter is null
-
geMRZ
Builds the characters sequence in the EID back side- Returns:
-
debug
-
debug
-
debug
-
debug
-
debug
-