org.fosstrak.epcis.captureclient
Class CaptureClientHelper

java.lang.Object
  extended by org.fosstrak.epcis.captureclient.CaptureClientHelper

public class CaptureClientHelper
extends Object

This is a helper class which encapsulates common functionality used within the capture client classes.

Author:
Marco Steybe

Nested Class Summary
static class CaptureClientHelper.EpcisEventType
           
static class CaptureClientHelper.ExampleEvents
          Implements a class that holds examples for the EPCIS Capture Interface Client.
 
Field Summary
static String[] ACTIONS
          The possible values for the "actions" parameter.
static String[] EPCIS_EVENT_NAMES
          The four possible event types, in human readable form.
static String toolTipBizTransID
           
static String toolTipBizTransType
           
static String toolTipDate
          The various tooltips.
static String toolTipInteger
           
static String toolTipOptional
           
static String toolTipUri
           
static String toolTipUris
           
static DecimalFormat XX_FORMAT
          Miscellaneous numeric formats used in formatting.
static DecimalFormat XXX_FORMAT
           
static DecimalFormat XXXX_FORMAT
           
 
Constructor Summary
CaptureClientHelper()
           
 
Method Summary
static boolean addAction(Document document, Element root, String action)
          Adds the given action value as <action> element to the XML document.
static boolean addBizLocation(Document document, Element root, String bizLocation)
          Adds the given bizLocation as <id> element inside a <bizLocation> element to the XML document.
static boolean addBizStep(Document document, Element root, String bizStep)
          Adds the given bizStep value as <bizStep> element to the XML document.
static boolean addBizTransactions(Document document, Element root, Map<String,String> bizTransactions)
          Adds the given mapping of business transactions ([business transaction IDs] -> [business transaction types]) as part of a <bizTransactionList> element to the XML document.
static boolean addChildEpcList(Document document, Element root, String childEPCs)
          Adds the EPCs from the given list of childEPCs as <epc> elements inside an <childEPCs> element to the XML document.
static boolean addDisposition(Document document, Element root, String disposition)
          Adds the given disposition value as <disposition> element to the XML document.
static boolean addEpcClass(Document document, Element root, String epcClass)
          Adds the given epcClass value as <epcClass> element to the XML document.
static boolean addEpcList(Document document, Element root, String epcList)
          Adds the EPCs from the given epcList as <epc> elements inside an <epcList> element to the XML document.
static boolean addEventTime(Document document, Element root, String eventTime)
          Adds the given eventTime value as <eventTime> element to the XML document.
static boolean addEventTimeZoneOffset(Document document, Element root, String eventTimeZoneOffset)
          Adds the given eventTimeZoneOffset value as <eventTimeZoneOffset> element to the XML document.
static boolean addParentId(Document document, Element root, String parentID)
          Adds the given parentID value as <parentID> element to the XML document.
static boolean addQuantity(Document document, Element root, String quantity)
          Adds the given quantity value as <quantity> element to the XML document.
static boolean addReadPoint(Document document, Element root, String readPoint)
          Adds the given readPoint as <id> element inside a <readPoint> element to the XML document.
static String format(Calendar cal)
          Formats a Calendar value into an ISO8601-compliant date/time string.
static ImageIcon getImageIcon(String filename)
          Loads ImageIcon from either JAR or filesystem.
static String getTimeZone(Calendar cal)
          Returns the time zone designator in a ISO6601-compliant format from the given Calendar value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XX_FORMAT

public static final DecimalFormat XX_FORMAT
Miscellaneous numeric formats used in formatting.


XXX_FORMAT

public static final DecimalFormat XXX_FORMAT

XXXX_FORMAT

public static final DecimalFormat XXXX_FORMAT

toolTipDate

public static final String toolTipDate
The various tooltips.

See Also:
Constant Field Values

toolTipUri

public static final String toolTipUri
See Also:
Constant Field Values

toolTipUris

public static final String toolTipUris
See Also:
Constant Field Values

toolTipInteger

public static final String toolTipInteger
See Also:
Constant Field Values

toolTipOptional

public static final String toolTipOptional
See Also:
Constant Field Values

toolTipBizTransType

public static final String toolTipBizTransType
See Also:
Constant Field Values

toolTipBizTransID

public static final String toolTipBizTransID
See Also:
Constant Field Values

ACTIONS

public static final String[] ACTIONS
The possible values for the "actions" parameter.


EPCIS_EVENT_NAMES

public static final String[] EPCIS_EVENT_NAMES
The four possible event types, in human readable form.

Constructor Detail

CaptureClientHelper

public CaptureClientHelper()
Method Detail

getTimeZone

public static String getTimeZone(Calendar cal)
Returns the time zone designator in a ISO6601-compliant format from the given Calendar value.

Parameters:
cal - The Calendar to be formatted.
Returns:
The time zone designator from the given Calendar.

format

public static String format(Calendar cal)
Formats a Calendar value into an ISO8601-compliant date/time string.

Parameters:
cal - The time value to be formatted into a date/time string.
Returns:
The formatted date/time string.

getImageIcon

public static ImageIcon getImageIcon(String filename)
Loads ImageIcon from either JAR or filesystem.

Parameters:
filename - The name of the file holding the image icon.
Returns:
The ImageIcon.

addQuantity

public static boolean addQuantity(Document document,
                                  Element root,
                                  String quantity)
Adds the given quantity value as <quantity> element to the XML document.

Parameters:
document - The Document to generate the <quantity> element from.
root - The root Element under which the <quantity> element should be generated.
quantity - The value for the <quantity> element.
Returns:
if the <quantity> element was successfully created, false otherwise.

addEpcClass

public static boolean addEpcClass(Document document,
                                  Element root,
                                  String epcClass)
Adds the given epcClass value as <epcClass> element to the XML document.

Parameters:
document - The Document to generate the <epcClass> element from.
root - The root Element under which the <epcClass> element should be generated.
epcClass - The value for the <epcClass> element.
Returns:
if the <epcClass> element was successfully created, false otherwise.

addChildEpcList

public static boolean addChildEpcList(Document document,
                                      Element root,
                                      String childEPCs)
Adds the EPCs from the given list of childEPCs as <epc> elements inside an <childEPCs> element to the XML document.

Parameters:
document - The Document to generate the <epc> and <childEPCs> element from.
root - The root Element under which the <childEPCs> element should be generated.
childEPCs - A space-separated list of EPCs.
Returns:
if the <childEPCs> element was successfully created, false otherwise.

addBizTransactions

public static boolean addBizTransactions(Document document,
                                         Element root,
                                         Map<String,String> bizTransactions)
Adds the given mapping of business transactions ([business transaction IDs] -> [business transaction types]) as part of a <bizTransactionList> element to the XML document.

Parameters:
document - The Document to generate the <bizTransactionList> element from.
root - The root Element under which the <bizTransactionList> element should be generated.
bizTransactions - A mapping of business transaction IDs to business transaction types.
Returns:
if the <bizTransactionList> element was successfully created, false otherwise.

addBizLocation

public static boolean addBizLocation(Document document,
                                     Element root,
                                     String bizLocation)
Adds the given bizLocation as <id> element inside a <bizLocation> element to the XML document.

Parameters:
document - The Document to generate the <id> and <bizLocation> elements from.
root - The root Element under which the <bizLocation> element should be generated.
bizLocation - The value for the <id> element.
Returns:
if the <bizLocation> element was successfully created, false otherwise.

addReadPoint

public static boolean addReadPoint(Document document,
                                   Element root,
                                   String readPoint)
Adds the given readPoint as <id> element inside a <readPoint> element to the XML document.

Parameters:
document - The Document to generate the <id> and <readPoint> elements from.
root - The root Element under which the <readPoint> element should be generated.
readPoint - The value for the <id> element.
Returns:
if the <readPoint> element was successfully created, false otherwise.

addDisposition

public static boolean addDisposition(Document document,
                                     Element root,
                                     String disposition)
Adds the given disposition value as <disposition> element to the XML document.

Parameters:
document - The Document to generate the <disposition> element from.
root - The root Element under which the <disposition> element should be generated.
disposition - The value for the <disposition> element.
Returns:
if the <disposition> element was successfully created, false otherwise.

addBizStep

public static boolean addBizStep(Document document,
                                 Element root,
                                 String bizStep)
Adds the given bizStep value as <bizStep> element to the XML document.

Parameters:
document - The Document to generate the <bizStep> element from.
root - The root Element under which the <bizStep> element should be generated.
bizStep - The value for the <bizStep> element.
Returns:
if the <bizStep> element was successfully created, false otherwise.

addAction

public static boolean addAction(Document document,
                                Element root,
                                String action)
Adds the given action value as <action> element to the XML document.

Parameters:
document - The Document to generate the <action> element from.
root - The root Element under which the <action> element should be generated.
action - The value for the <action> element.
Returns:
if the <action> element was successfully created, false otherwise.

addEpcList

public static boolean addEpcList(Document document,
                                 Element root,
                                 String epcList)
Adds the EPCs from the given epcList as <epc> elements inside an <epcList> element to the XML document.

Parameters:
document - The Document to generate the <epc> and <epcList> element from.
root - The root Element under which the <childEPCs> element should be generated.
epcList - A space-separated list of EPCs.
Returns:
if the <epcList> element was successfully created, false otherwise.

addParentId

public static boolean addParentId(Document document,
                                  Element root,
                                  String parentID)
Adds the given parentID value as <parentID> element to the XML document.

Parameters:
document - The Document to generate the <parentID> element from.
root - The root Element under which the <parentID> element should be generated.
parentID - The value for the <parentID> element.
Returns:
if the <parentID> element was successfully created, false otherwise.

addEventTime

public static boolean addEventTime(Document document,
                                   Element root,
                                   String eventTime)
Adds the given eventTime value as <eventTime> element to the XML document.

Parameters:
document - The Document to generate the <eventTime> element from.
root - The root Element under which the <eventTime> element should be generated.
eventTime - The value for the <eventTime> element.
Returns:
if the <eventTime> element was successfully created, false otherwise.

addEventTimeZoneOffset

public static boolean addEventTimeZoneOffset(Document document,
                                             Element root,
                                             String eventTimeZoneOffset)
Adds the given eventTimeZoneOffset value as <eventTimeZoneOffset> element to the XML document.

Parameters:
document - The Document to generate the <eventTimeZoneOffset> element from.
root - The root Element under which the <eventTimeZoneOffset> element should be generated.
eventTimeZoneOffset - The value for the <eventTimeZoneOffset> element.
Returns:
if the <eventTimeZoneOffset> element was successfully created, false otherwise.


Copyright © 2010. All Rights Reserved.