com.ibm.rfid.epc.datahandler
Class DOD
java.lang.Object
com.ibm.rfid.epc.datahandler.AbstractHandler
com.ibm.rfid.epc.datahandler.DOD
- All Implemented Interfaces:
- DataHandler
public class DOD
- extends AbstractHandler
- implements DataHandler
Manages an instance of a data handler used to encode a DOD CAGE (Commercial And Government Entity)
or DoDAAC (Dept. of Defense Activity Address Code).
Although there is no EAN.UCC number that can be used to directly encode a CAGE or DoDAAC,
this handler still wraps the input data to support creation of the encoding.
The input data may be specified in one of two forms, both of which are strings.
The first form is a simple string of the following data field:
CAGE or DoDAAC - a number assigned by the U.S Department of Defense to a supplier
or internal logistics point respectiviely. Unlike all other encoding forms this number
is not managed by EPCglobal, and although a CAGE or DoDACC is not a company prefix,
this handler treats it as such and calls it as such. This input form will will generate a
serial number that is unique with respect to the CAGE or DoDAAC and commission
an EPC using the specified CAGE or DoDAAC and generated serial number.
An example of this input would be:
"123456"
The second form is a formatted string of the following fields with literal field labels and
explicit seperators:
CAGE or DoDAAC - see above
Serial number - a number to provide uniqueness for the specified CAGE or DoDAAC
An example of this input would be:
"cageordodaac=123456;serial=12345678"
This input form will commission
an EPC using the specified fields, in doing so, it will not generate a serial number, instead it
will use the one provided, as such, it is the responsiblity of the provider to ensure unqiueness.
Field Summary |
static java.lang.String |
COPYRIGHT
|
Fields inherited from interface com.ibm.rfid.epc.datahandler.DataHandler |
DOD, GIAI, GID, GLN, GRAI, GTIN14, MAX_CAGE_DODAAC_LENGTH, MAX_EAN_UCC_COMPANY_PREFIX_LENGTH, MAX_GID_GENERAL_MANAGER_LENGTH, MAX_NDC10_COMPANY_PREFIX_LENGTH, MIN_CAGE_DODAAC_LENGTH, MIN_EAN_UCC_COMPANY_PREFIX_LENGTH, MIN_GID_GENERAL_MANAGER_LENGTH, MIN_NDC10_COMPANY_PREFIX_LENGTH, NDC10, SSCC18 |
Constructor Summary |
DOD(java.lang.String cageDoDAAC,
int cageDoDAACLength,
java.lang.String encodingType)
Creates an instance of a data handler for a DoD CAGE or DoDAAC, a unique alphanumeric
code used to identify a government supplier or government entity respectively. |
Method Summary |
java.lang.String |
getUnserializedPureId()
Create the portion of the Id URI (pure Id) associated with this handler this is not serialized,
i.e. |
boolean |
validate(java.lang.String encodingType)
Validate that the input data string meets criteria for a CAGE or DoDAAC, i.e., 5 or 6 characters
in length, alphanumeric with the exception of 'I' (eye) or 'O' (oh) and is appropriate for the encoding type,
i.e. |
Methods inherited from class com.ibm.rfid.epc.datahandler.AbstractHandler |
getCompanyPrefix, getCompanyPrefixLength, getHandlerType, getInputData, getMaxCompanyPrefixLength, getMinCompanyPrefixLength, getPureId, getSerialNumber, serialize, setCompanyPrefix, setCompanyPrefixLength, setHandlerType, toString, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
COPYRIGHT
public static final java.lang.String COPYRIGHT
- See Also:
- Constant Field Values
DOD
public DOD(java.lang.String cageDoDAAC,
int cageDoDAACLength,
java.lang.String encodingType)
throws InvalidFormatException
- Creates an instance of a data handler for a DoD CAGE or DoDAAC, a unique alphanumeric
code used to identify a government supplier or government entity respectively.
- Parameters:
cageDoDAAC
- alphanumeric string data to be managed by this handler. Input data may be either of
two forms discussed above.cageDoDAACLength
- integer length of the CAGE or DoDAACencodingType
- string encoding type
- Throws:
InvalidFormatException
- if any of the input data fails validation
validate
public boolean validate(java.lang.String encodingType)
throws InvalidFormatException
- Validate that the input data string meets criteria for a CAGE or DoDAAC, i.e., 5 or 6 characters
in length, alphanumeric with the exception of 'I' (eye) or 'O' (oh) and is appropriate for the encoding type,
i.e. not tyring to create a usdod-64 encoding using a DoDAAC as input which is not allowed
- Parameters:
encodingType
- string encoding type
- Returns:
- true if input is a valid CAGE or DoDAAC
- Throws:
InvalidFormatException
getUnserializedPureId
public java.lang.String getUnserializedPureId()
- Create the portion of the Id URI (pure Id) associated with this handler this is not serialized,
i.e. is determined by the input data only, and thus not unique.
- Specified by:
getUnserializedPureId
in interface DataHandler
- Returns:
- string unserialized partial EPCglobal ID URI of the form:
urn:epc:id:dod:<CAGEorDoDAAC>.
where the trailing period is included as it seperates the next field (serial number) and
<CAGEorDoDAAC> is defined above.
Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.