Package org.europa.together.application
Class ZxingGenerator
java.lang.Object
org.europa.together.application.ZxingGenerator
- All Implemented Interfaces:
QrCodeGenerator
Implementation of the QR Code Generator.
-
Field Summary
Fields inherited from interface org.europa.together.business.QrCodeGenerator
FEATURE_ID
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtract (decode) from a image file the information as String.boolean
Encode from a given String the image and store it on the configured path.generateDataForCalendarEvent
(String event, ZonedDateTime start, ZonedDateTime end) Encode an calender event.generateDataForGeoLocation
(String latitude, String longitude) A geo URI may be used to encode a point on the earth, including altitude.generateDataForUrl
(String url) Encode an URL which will opened in a web browser.generateDataForvCard
(Map<String, String> contact) Create a vCard (Version 3.0) data structure.void
Configure the generator with the dimension (height and width) of the QR Code Image.
-
Constructor Details
-
ZxingGenerator
public ZxingGenerator()Constructor.
-
-
Method Details
-
setup
Description copied from interface:QrCodeGenerator
Configure the generator with the dimension (height and width) of the QR Code Image. Height = Weight; the produced image will be always an square. It also define where the file will be stored.- Specified by:
setup
in interfaceQrCodeGenerator
- Parameters:
fileOutputPath
- s Stringdimensions
- as int
-
generateDataForvCard
Description copied from interface:QrCodeGenerator
Create a vCard (Version 3.0) data structure. URL: https://en.wikipedia.org/wiki/VCard
Property Set:
gender: Mr.
name: Doe
surname: John
title:
organization:
role
home-street:
home-city:
home-zipcode:
home-state:
home-country:
home-phone:
home-mobile:
work-street:
work-city:
work-zipcode:
work-state:
work-country:
work-phone:
work-mobile:
e-mail: john.doe@sample.org
homepage:- Specified by:
generateDataForvCard
in interfaceQrCodeGenerator
- Parameters:
contact
- as Map- Returns:
- dataStructure as String
-
generateDataForCalendarEvent
Description copied from interface:QrCodeGenerator
Encode an calender event.- Specified by:
generateDataForCalendarEvent
in interfaceQrCodeGenerator
- Parameters:
event
- as Stringstart
- as ZonedDateTimeend
- as ZonedDateTime- Returns:
- dataStructure as String
-
generateDataForUrl
Description copied from interface:QrCodeGenerator
Encode an URL which will opened in a web browser.- Specified by:
generateDataForUrl
in interfaceQrCodeGenerator
- Parameters:
url
- as String- Returns:
- dataStructure as String
-
generateDataForGeoLocation
Description copied from interface:QrCodeGenerator
A geo URI may be used to encode a point on the earth, including altitude. For example, to encode the Google's New York office, which is at 40.71872 deg N latitude, 73.98905 deg W longitude, at a point 100 meters above the office, one would encode "geo:40.71872,-73.98905,100".
A reader might open a local mapping application like Google Maps to this location and zoom accordingly, or could open a link to this location on a mapping web site like Google Maps in the device's web browser.- Specified by:
generateDataForGeoLocation
in interfaceQrCodeGenerator
- Parameters:
latitude
- as Stringlongitude
- as String- Returns:
- dataStructure as String
-
encode
Description copied from interface:QrCodeGenerator
Encode from a given String the image and store it on the configured path.- Specified by:
encode
in interfaceQrCodeGenerator
- Parameters:
data
- as String- Returns:
- true on success
-
decode
Description copied from interface:QrCodeGenerator
Extract (decode) from a image file the information as String.- Specified by:
decode
in interfaceQrCodeGenerator
- Parameters:
qrCode
- as File- Returns:
- the content as String
-