HanXinExtCodetextBuilder

Inheritance: java.lang.Object

public class HanXinExtCodetextBuilder

Extended codetext generator for Han Xin Code for Extended Mode of HanXinEncodeMode


//Extended codetext mode
 //create codetext
 HanXinExtCodetextBuilder codeTextBuilder = new HanXinExtCodetextBuilder();
 codeTextBuilder.addGB18030TwoByte("\u6f04");
 codeTextBuilder.addGB18030FourByte("\u3401");
 codeTextBuilder.addCommonChineseRegionOne("\u5168");
 codeTextBuilder.addCommonChineseRegionTwo("\u8785");
 codeTextBuilder.addNumeric("123");
 codeTextBuilder.addText("qwe");
 codeTextBuilder.addUnicode("\u0131nt\u0259\u02c8n\u0283\u0259n\u0259l");
 codeTextBuilder.addECI("\u0391\u0392\u0393\u0394\u0395", 9);
 codeTextBuilder.addAuto("abc");
 codeTextBuilder.addBinary("abc");
 codeTextBuilder.addURI("backslashes_should_be_doubled\\000555:test");
 codeTextBuilder.addGS1("(01)03453120000011(17)191125(10)ABCD1234(21)10");
 String expectedStr = "\u6f04\u3401\u5168\u8785123qwe\u0131nt\u0259\u02c8n\u0283\u0259n\u0259l\u0391\u0392\u0393\u0394\u0395abcabcbackslashes_should_be_doubled\\000555:test(01)03453120000011(17)191125(10)ABCD1234(21)10";
 //generate codetext
 String str = codeTextBuilder.getExtendedCodetext();
 //generate
 BarcodeGenerator bg = new BarcodeGenerator(EncodeTypes.HanXin, str);
 bg.getParameters().getBarcode().getHanXin().setHanXinEncodeMode(HanXinEncodeMode.EXTENDED);
 Bitmap img = bg.generateBarCodeImage();
 BarCodeReader r = new BarCodeReader(img, DecodeType.HAN_XIN))
 BarcodeResult[] found = r.readBarCodes();
 Assert.assertEquals(1, found.length);
 Assert.assertEquals(expectedStr, found[0].getCodeText());

Constructors

ConstructorDescription
HanXinExtCodetextBuilder()

Methods

MethodDescription
addAuto(String text)Adds codetext fragment in Auto mode
addBinary(String text)Adds codetext fragment in Binary mode
addCommonChineseRegionOne(String text)Adds codetext fragment in Common Chinese Region One mode
addCommonChineseRegionTwo(String text)Adds codetext fragment in Common Chinese Region Two mode
addECI(String text, int encoding)Adds codetext fragment in ECI mode
addGB18030FourByte(String text)Adds codetext fragment in GB18030 Four Byte mode
addGB18030TwoByte(String text)Adds codetext fragment in GB18030 Two Byte mode
addGS1(String text)Adds codetext fragment in GS1 mode
addNumeric(String text)Adds codetext fragment in Numeric mode
addText(String text)Adds codetext fragment in Text mode
addURI(String text)Adds codetext fragment in URI mode
addUnicode(String text)Adds codetext fragment in Unicode mode
equals(Object arg0)
getClass()
getExtendedCodetext()Returns codetext from Extended mode codetext builder
hashCode()
notify()
notifyAll()
toString()
wait()
wait(long arg0)
wait(long arg0, int arg1)

HanXinExtCodetextBuilder()

public HanXinExtCodetextBuilder()

addAuto(String text)

public void addAuto(String text)

Adds codetext fragment in Auto mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addBinary(String text)

public void addBinary(String text)

Adds codetext fragment in Binary mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addCommonChineseRegionOne(String text)

public void addCommonChineseRegionOne(String text)

Adds codetext fragment in Common Chinese Region One mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addCommonChineseRegionTwo(String text)

public void addCommonChineseRegionTwo(String text)

Adds codetext fragment in Common Chinese Region Two mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addECI(String text, int encoding)

public void addECI(String text, int encoding)

Adds codetext fragment in ECI mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string
encodingintECI encoding in integer format

addGB18030FourByte(String text)

public void addGB18030FourByte(String text)

Adds codetext fragment in GB18030 Four Byte mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addGB18030TwoByte(String text)

public void addGB18030TwoByte(String text)

Adds codetext fragment in GB18030 Two Byte mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addGS1(String text)

public void addGS1(String text)

Adds codetext fragment in GS1 mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addNumeric(String text)

public void addNumeric(String text)

Adds codetext fragment in Numeric mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addText(String text)

public void addText(String text)

Adds codetext fragment in Text mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addURI(String text)

public void addURI(String text)

Adds codetext fragment in URI mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

addUnicode(String text)

public void addUnicode(String text)

Adds codetext fragment in Unicode mode

Parameters:

ParameterTypeDescription
textjava.lang.StringCodetext string

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

ParameterTypeDescription
arg0java.lang.Object

Returns: boolean

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getExtendedCodetext()

public String getExtendedCodetext()

Returns codetext from Extended mode codetext builder

Returns: java.lang.String - Codetext in Extended mode

hashCode()

public native int hashCode()

Returns: int

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

toString()

public String toString()

Returns: java.lang.String

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

ParameterTypeDescription
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypeDescription
arg0long
arg1int