|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jbarcodebean.model.AbstractBarcodeStrategy net.sourceforge.jbarcodebean.model.Code93
public class Code93
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sourceforge.jbarcodebean.model.AbstractBarcodeStrategy |
---|
AbstractBarcodeStrategy.CharacterCode |
Field Summary | |
---|---|
protected static char |
SHIFT_DOLLAR
|
protected static char |
SHIFT_PERCENT
|
protected static char |
SHIFT_PLUS
|
protected static char |
SHIFT_SLASH
|
Fields inherited from interface net.sourceforge.jbarcodebean.model.BarcodeStrategy |
---|
MANDATORY_CHECKSUM, NO_CHECKSUM, OPTIONAL_CHECKSUM |
Constructor Summary | |
---|---|
Code93()
|
Method Summary | |
---|---|
protected java.lang.String |
augmentWithChecksum(java.lang.String text)
Subclasses implement this method to calculate the checksum from the text to encode, and return a String containing the text with the checksum included. |
EncodedBarcode |
encode(java.lang.String textToEncode,
boolean checked)
This implementation carries out the following steps: Call AbstractBarcodeStrategy.preprocess(java.lang.String)
Call AbstractBarcodeStrategy.augmentWithChecksum(java.lang.String) to add in the checksum
Call AbstractBarcodeStrategy.postprocess(java.lang.String)
Adds in the start and end sentinels
Use the CharacterCode array returned by getCodes to encode the text into a barcode
Insert left and right margins
Return EncodedBarcode object
|
protected java.lang.String |
getBarcodeLabelText(java.lang.String text)
Subclasses implement this method to return the text which appears below the barcode. |
protected AbstractBarcodeStrategy.CharacterCode[] |
getCodes()
Subclasses implement this method to return an array of CharacterCode
objects, representing all possible encodings of bars and spaces for
every encodable character. |
protected byte |
getMarginWidth()
Sublclasses implement this method to return the width of the whitespace that must appear on each side of the barcode. |
protected char |
getStartSentinel()
Subclasses implement this method to return the start sentinel character. |
protected char |
getStopSentinel()
Subclasses implement this method to return the stop sentinel character. |
protected boolean |
isInterleaved()
Subclasses must implement this method to return true or false depending on whether the barcode type is interleaved. |
protected java.lang.String |
postprocess(java.lang.String text)
Subclasses implement this method to perform any postprocessing required to the text after including the checksum. |
protected java.lang.String |
preprocess(java.lang.String text)
Subclasses implement this method to perform any preprocessing necessary on the original text to encode. |
int |
requiresChecksum()
Subclasses implement this method to determine whether this type of barcode has a mandatory, optional or no checksum. |
Methods inherited from class net.sourceforge.jbarcodebean.model.AbstractBarcodeStrategy |
---|
computeSize, getCharacterCode, getCharacterCode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final char SHIFT_DOLLAR
protected static final char SHIFT_PERCENT
protected static final char SHIFT_SLASH
protected static final char SHIFT_PLUS
Constructor Detail |
---|
public Code93()
Method Detail |
---|
protected java.lang.String augmentWithChecksum(java.lang.String text) throws BarcodeException
AbstractBarcodeStrategy
augmentWithChecksum
in class AbstractBarcodeStrategy
text
- The text to encode (after preprocessing - see
AbstractBarcodeStrategy.preprocess(java.lang.String)
).
BarcodeException
protected java.lang.String getBarcodeLabelText(java.lang.String text)
AbstractBarcodeStrategy
getBarcodeLabelText
in class AbstractBarcodeStrategy
text
- The raw text to encode.
protected AbstractBarcodeStrategy.CharacterCode[] getCodes()
AbstractBarcodeStrategy
CharacterCode
objects, representing all possible encodings of bars and spaces for
every encodable character.
getCodes
in class AbstractBarcodeStrategy
CharacterCode
objects, one for each possible character
that can be encoded using this strategy.protected byte getMarginWidth()
AbstractBarcodeStrategy
getMarginWidth
in class AbstractBarcodeStrategy
protected char getStartSentinel()
AbstractBarcodeStrategy
getStartSentinel
in class AbstractBarcodeStrategy
protected char getStopSentinel()
AbstractBarcodeStrategy
getStopSentinel
in class AbstractBarcodeStrategy
protected boolean isInterleaved()
AbstractBarcodeStrategy
isInterleaved
in class AbstractBarcodeStrategy
protected java.lang.String postprocess(java.lang.String text)
AbstractBarcodeStrategy
postprocess
in class AbstractBarcodeStrategy
text
- String to process (returned by
AbstractBarcodeStrategy.augmentWithChecksum(java.lang.String)
).
protected java.lang.String preprocess(java.lang.String text) throws BarcodeException
AbstractBarcodeStrategy
AbstractBarcodeStrategy.augmentWithChecksum(java.lang.String)
method.
preprocess
in class AbstractBarcodeStrategy
text
- The raw text to encode.
BarcodeException
- Typically caused by passing in
a String containing illegal characters (characters that cannot be encoded in
this type of barcode).public int requiresChecksum()
BarcodeStrategy
public EncodedBarcode encode(java.lang.String textToEncode, boolean checked) throws BarcodeException
AbstractBarcodeStrategy
AbstractBarcodeStrategy.preprocess(java.lang.String)
AbstractBarcodeStrategy.augmentWithChecksum(java.lang.String)
to add in the checksumAbstractBarcodeStrategy.postprocess(java.lang.String)
encode
in interface BarcodeStrategy
encode
in class AbstractBarcodeStrategy
textToEncode
- The raw text to encode.checked
- True if a checksum is to be calculated, False if not.
EncodedBarcode
object.
BarcodeException
- Typically caused by passing in
a String containing illegal characters (characters that cannot be encoded in
this type of barcode).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |