|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.rfid.epc.datahandler.AbstractHandler
public abstract class AbstractHandler
Field Summary | |
---|---|
protected java.lang.String |
companyPrefix
|
protected int |
companyPrefixLength
|
static java.lang.String |
COPYRIGHT
|
protected java.lang.String |
handlerType
|
protected java.lang.String |
inputData
|
protected int |
maxCompanyPrefixLength
|
protected int |
minCompanyPrefixLength
|
protected java.lang.String |
pureId
|
protected java.lang.String |
serialNumber
|
protected boolean |
useLocalConfigMgr
|
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 | |
---|---|
AbstractHandler(java.lang.String dataString,
int companyPrefixLength,
java.lang.String handlerType,
int minCompanyPrefixLength,
int maxCompanyPrefixLength,
java.lang.String encodingType)
Sets the base class data fields of the data handler and performs minimal validation |
Method Summary | |
---|---|
java.lang.String |
getCompanyPrefix()
Gets the EAN.UCC portion of the input data |
int |
getCompanyPrefixLength()
|
java.lang.String |
getHandlerType()
Gets the string name of the input handler used to construct this insntance. |
java.lang.String |
getInputData()
Gets the input data that was used to construct this instance of a data handler |
int |
getMaxCompanyPrefixLength()
Gets the maximum length that a company prefix can be for this input handler type. |
int |
getMinCompanyPrefixLength()
Gets the minimum length that a company prefix can be for this input handler type. |
java.lang.String |
getPureId()
Gets the EPCglobal pure identity of this handler. |
java.lang.String |
getSerialNumber()
Gets the serial number associated with the input data of this data handler |
java.lang.String |
serialize(java.lang.String discriminator)
Create the pure id associated with this handler. |
void |
setCompanyPrefix(java.lang.String companyPrefix)
Sets the company prefix to the specified string |
void |
setCompanyPrefixLength(int companyPrefixLength)
Sets the integer length of the CP for this handler |
void |
setHandlerType(java.lang.String handlerType)
Sets the data type of this handler |
java.lang.String |
toString()
|
boolean |
validate(int expectedLength,
boolean validateChecksum)
Validates that: the data of this handler contains only numeric characters the length of the data matches the expected length the checksum of the data is correct, using the GTIN checksum calculation |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ibm.rfid.epc.datahandler.DataHandler |
---|
getUnserializedPureId |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
protected int companyPrefixLength
protected int minCompanyPrefixLength
protected int maxCompanyPrefixLength
protected java.lang.String inputData
protected java.lang.String handlerType
protected java.lang.String pureId
protected java.lang.String companyPrefix
protected java.lang.String serialNumber
protected boolean useLocalConfigMgr
Constructor Detail |
---|
public AbstractHandler(java.lang.String dataString, int companyPrefixLength, java.lang.String handlerType, int minCompanyPrefixLength, int maxCompanyPrefixLength, java.lang.String encodingType) throws InvalidFormatException
dataString
- string input datacompanyPrefixLength
- length of company prefix portion of dataStringhandlerType
- the string type name of this handlerminCompanyPrefixLength
- minimum cp length for this type of handlermaxCompanyPrefixLength
- maximum cp length for this type of handlerencodingType
- string encoding type
InvalidFormatException
- if the input to create the data handler is invalidMethod Detail |
---|
public boolean validate(int expectedLength, boolean validateChecksum) throws InvalidFormatException
expectedLength
- integer length the data contained in this handler is expected to bevalidateChecksum
- boolean flag indicating whether checksum of data should be validated
InvalidFormatException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getInputData()
DataHandler
getInputData
in interface DataHandler
public int getCompanyPrefixLength()
public void setCompanyPrefixLength(int companyPrefixLength)
companyPrefixLength
- integer lengthpublic int getMinCompanyPrefixLength()
DataHandler
getMinCompanyPrefixLength
in interface DataHandler
public int getMaxCompanyPrefixLength()
DataHandler
getMaxCompanyPrefixLength
in interface DataHandler
public java.lang.String getHandlerType()
DataHandler
getHandlerType
in interface DataHandler
public void setHandlerType(java.lang.String handlerType)
dataType
- string name of data typepublic java.lang.String getCompanyPrefix()
getCompanyPrefix
in interface DataHandler
public void setCompanyPrefix(java.lang.String companyPrefix)
string
- company prefixpublic java.lang.String serialize(java.lang.String discriminator) throws com.ibm.rfid.epc.config.SerialGenerationException
serialize
in interface DataHandler
discriminator
- string that can be used assign ranges of serial numbers for the
same product to different entities/locations/objects. This string can be an
an empty string if it is not desired to use this feature.
com.ibm.rfid.epc.config.SerialGenerationException
- if a serial number cannot be commissioned for this EPCpublic java.lang.String getPureId()
public java.lang.String getSerialNumber()
getSerialNumber
in interface DataHandler
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |