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
-
Method Summary
Modifier and TypeMethodDescriptionstatic be.belgium.eid.objects.IDAddress
address2IDAddress(Address address)
static String
debug(be.belgium.eid.objects.IDAddress beIDAddress)
static String
debug(be.belgium.eid.objects.IDData beIDData)
static String
debug(be.belgium.eid.objects.IDPhoto beIDPhoto)
static String
debug(be.belgium.eid.objects.IDVersion beIDVersionInfo)
static String
debug(be.belgium.eid.security.CertificateChain beIDCertificateChain)
static BufferedImage
decodeImage(byte[] photoData)
static byte[]
decodePhotoBytes(String encoded)
static byte[]
encodeImage(Image image)
static String
geMRZ(be.belgium.eid.objects.IDData beIDData)
Builds the characters sequence in the EID back sidestatic Base64.Encoder
static Person
getPerson(be.belgium.eid.objects.IDData idData)
static boolean
idData2Person(be.belgium.eid.objects.IDData idData, Person person)
static boolean
static boolean
static VirtualBeID
Loads data from the given file to initialize theVirtualBeID
.static VirtualBeID
loadOriginalFile(File file)
Loads data from the given file to initialize theVirtualBeID
.static be.belgium.eid.objects.IDData
person2IDData(Person person)
static VirtualBeID
person2Virtual(PersonExt person)
static int
printEidPanel(Graphics graphics, PageFormat pageFormat, int pageIndex, VirtualBeID virtualBeID)
Prints the page at the specified index into the specifiedGraphics
context in the specified format.static void
saveBeID(File file, VirtualBeID virtualBeID)
Exports the virtual BEID to the given XML-file.static boolean
setIdAddress(be.belgium.eid.objects.IDAddress idAddress, Address address)
static void
virtual2PersonExt(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 specifiedGraphics
context in the specified format. APrinterJob
calls thePrintable
interface 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. TheGraphics
class or subclass implements thePrinterGraphics
interface to provide additional information. If thePrintable
object 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
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
-
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
VirtualBeID
object 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
VirtualBeID
object 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
-