com.ibm.rfid.epc.datahandler
Class GID
java.lang.Object
com.ibm.rfid.epc.datahandler.AbstractHandler
com.ibm.rfid.epc.datahandler.GID
- All Implemented Interfaces:
- DataHandler
public class GID
- extends AbstractHandler
- implements DataHandler
Manages an instance of a data handler used to encode an EPCglobal General Identifier (GID).
Although there is no EAN.UCC number that can be used to directy encode a GID,
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 concatenated data fields:
General manager number - a number assigned by EPCglobal to the subscriber.
Although a general manager number is NOT a company prefix according to EPCglobal,
this handler treats it as such and calls it as such.
Object class - a number assigned by the subscriber, not EPCglobal, to identify a class of 'things'.
An example of this input would be:
"12345678901234"
where if the company prefix length were specified as 6, the general manager
number would be the first six characters of the string "123456" and the object class would be the
remaining characters "78901234". This input form will commission an EPC and generate a unique
serial number for the combination of the company prefix and object class.
The second form is a formatted string of the following fields with literal field labels and
explicit seperators.
General manager number - see above
Object class - see above
Serial number - a number to provide uniqueness for the specified general maanger and object class
An example of this input would be:
"generalmanager=123456;objectclass=78901234;serial=12345678"
This input form will commission
an EPC using the specified fields, 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 |
GID(java.lang.String dataString,
int companyPrefixLength,
java.lang.String encodingType)
Creates an instance of a data handler for an GID data type. |
Method Summary |
java.lang.String |
getObjectClass()
Gets the object class field of this data handler |
java.lang.String |
getUnserializedPureId()
Create the portion of the ID URI (pure id) associated with this handler this is not serialized,
i.e. |
void |
setObjectClass(java.lang.String objectClass)
Sets the object class field of this data handler. |
boolean |
validate()
Validate that the general manager number and object class meet the ECPglobal criteria for
valid values |
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
GID
public GID(java.lang.String dataString,
int companyPrefixLength,
java.lang.String encodingType)
throws InvalidFormatException
- Creates an instance of a data handler for an GID data type.
- Parameters:
dataString
- numeric string data to be managed by this handler. Input data may be either of
two forms discussed above.companyPrefixLength
- length of CP portion of the data stringencodingType
- string encoding type
- Throws:
InvalidFormatException
- if any of the input data fails validation
validate
public boolean validate()
throws InvalidFormatException
- Validate that the general manager number and object class meet the ECPglobal criteria for
valid values
- Returns:
- true if both general manager number and object class are valid
- Throws:
InvalidFormatException
- if either fields are invalid
getObjectClass
public java.lang.String getObjectClass()
- Gets the object class field of this data handler
- Returns:
- string object class
setObjectClass
public void setObjectClass(java.lang.String objectClass)
- Sets the object class field of this data handler.
- Parameters:
objectClass
- string object class of this data handler
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:gid:<GeneralManager>.<ObjectClass>.
where the trailing period is included as it seperates the next field (serial number) and
<GeneralManager> and <ObjectClass> are defined above.
Copyright © 2005 - 2009 IBM Corp. All Rights Reserved.