EAN-130000000004022   EAN-13 barcode 0000000004022
UPC-A000000004022   UPC-A barcode 000000004022
UPC-E00040202   UPC-E barcode 00040202
Product NameHellions Phantam Grenade Launcher Bits Dark Eldar Warhammer 40k
CategoryHome: Furniture / Decoration
Amazon.comA Buy on Amazon ~ B001I6O8QC
Width56 inches    (convert)
Height26 inches    (convert)
Long DescriptionHome Styles Homestead Entertainment Stand in Pine Finish - 5527-12 Dimensions: 56 "W x 20 "D x 26"H Weight: Approx 124 lbs Solid Wood and Wood Veneers. Pine Finish. Two wood framed doors.
Created04-14-2012 9:59:05pm
Modified12-29-2016 1:16:08pm
Search Googleby EAN or by Title
Query Time0.0014250

This is a basic implementation of a service that provides retrieval access to the EANData.com UPC web site. Its was coded to verify basic  proof-of-concept for development of another application and was not intended to provide be anything more than basic functionality in the retrieval  of UPC data from the EANData.com web site.

There are several places where simple code was left in place rather than using more advanced Java features/methods to allow for easier  understanding of junior developers. Not much time spent refactoring or cleaning up the code. It is provided as a starting point only.

It contains a Factory service that returns a service object configured using the UcpService.properties (see below) file found in the class path of  the executed code. The UpcQueryService can respond with an implementation of the UpcResponse and supporting interfaces or with an InputStream  allowing direct access to the response from the from the EANData.com web site.

JSR 353 is the Java API for JSON is currently under development (http://java.net/projects/json-processing-spec & http://java.net/projects/jsonp).  The several Java JSON implementations seemed to be more than I was wanting/needing so I wrote a basic parser to provide JSON parsing capability  needed. Its not perfect but is a good basic start.

Download the example source code

The UpcService.properties must be configured.

Url (Required)
provides the address used to query UPC data. The additional parameters are added to retrieve the requested information.

ApiKeyCode (Required)
Provided from EANData.com when your account is setup.

Mode (Required)
The manner in which the data will be retrieved from the EANData.com web site.
AutoRetrieveGraphics (Optional)
Boolean to indicate whether the graphics, when indicated by a Url, are to be automatically retrieved at the same time with the UPC data. Default is false. A factory method allows for the this property to be overridden at the time the UpcQueryService is created.