Package org.europa.together.business
Interface QrCodeGenerator
- All Known Implementing Classes:
ZxingGenerator
@API(status=STABLE,
since="1.0",
consumers="ZxingGenerator")
@Component
public interface QrCodeGenerator
Generates Quick Response Codes (QR Codes). The generator provides
DataStructures like calendar entry or contact information (PIM). It's
implemented an encoder and also an decoder.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- elmar.dott@gmail.com
-
Field Summary
Fields -
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.
-
Field Details
-
FEATURE_ID
Identifier for the given feature.- See Also:
-
-
Method Details
-
setup
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.- Parameters:
dimensions
- as intfileOutputPath
- s String
-
encode
Encode from a given String the image and store it on the configured path.- Parameters:
data
- as String- Returns:
- true on success
-
decode
Extract (decode) from a image file the information as String.- Parameters:
qrCode
- as File- Returns:
- the content as String
-
generateDataForvCard
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:- Parameters:
contact
- as Map- Returns:
- dataStructure as String
-
generateDataForCalendarEvent
@API(status=STABLE, since="2.1") String generateDataForCalendarEvent(String event, ZonedDateTime start, ZonedDateTime end) Encode an calender event.- Parameters:
event
- as Stringstart
- as ZonedDateTimeend
- as ZonedDateTime- Returns:
- dataStructure as String
-
generateDataForUrl
Encode an URL which will opened in a web browser.- Parameters:
url
- as String- Returns:
- dataStructure as String
-
generateDataForGeoLocation
@API(status=STABLE, since="1.0") String generateDataForGeoLocation(String latitude, String longitude) 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.- Parameters:
longitude
- as Stringlatitude
- as String- Returns:
- dataStructure as String
-