OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 181 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 181 Rev 183
Line 19... Line 19...
19
    // character.
19
    // character.
20
    // ]e2 : GS1 Composite : Data packet containing the data following an escape mechanism
20
    // ]e2 : GS1 Composite : Data packet containing the data following an escape mechanism
21
    // character.
21
    // character.
22
    // ]d2 : GS1 DataMatrix : Standard AI element strings
22
    // ]d2 : GS1 DataMatrix : Standard AI element strings
23
    private static final String GS1_DATAMATRIX_SCANNER_PREFIX = "]d2";
23
    private static final String GS1_DATAMATRIX_SCANNER_PREFIX = "]d2";
-
 
24
    private static final String GS1_DATAMATRIX_SCANNER_PREFIX_2 = "]D2";
24
    // ]Q3 : GS1 QR Code : Standard AI element strings
25
    // ]Q3 : GS1 QR Code : Standard AI element strings
25
    private static final String GS1_QRCODE_SCANNER_PREFIX = "]Q3";
26
    private static final String GS1_QRCODE_SCANNER_PREFIX = "]Q3";
26
    // ]J1 : GS1 DotCode : Standard AI element strings
27
    // ]J1 : GS1 DotCode : Standard AI element strings
27
 
28
 
28
    static final int ERROR_CODE_INVALID_GS1_SCAN = 0;
29
    static final int ERROR_CODE_INVALID_GS1_SCAN = 0;
Line 49... Line 50...
49
    public GS1Util(int separator) {
50
    public GS1Util(int separator) {
50
        this.separator = separator;
51
        this.separator = separator;
51
    }
52
    }
52
 
53
 
53
    public GS1AIElements parseFromScanner(String scan) throws GS1ParseException {
54
    public GS1AIElements parseFromScanner(String scan) throws GS1ParseException {
54
        if (scan.startsWith(GS1_DATAMATRIX_SCANNER_PREFIX) || scan.startsWith(GS1_128_SCANNER_PREFIX) || scan.startsWith(GS1_DATABAR_SCANNER_PREFIX) || scan.startsWith(GS1_QRCODE_SCANNER_PREFIX)) {
55
        if (scan.startsWith(GS1_DATAMATRIX_SCANNER_PREFIX) || scan.startsWith(GS1_DATAMATRIX_SCANNER_PREFIX_2) || scan.startsWith(GS1_128_SCANNER_PREFIX) || scan.startsWith(GS1_DATABAR_SCANNER_PREFIX)
-
 
56
                || scan.startsWith(GS1_QRCODE_SCANNER_PREFIX)) {
55
            return parse(scan.substring(3));
57
            return parse(scan.substring(3));
56
        }
58
        }
57
        return parse(scan);
59
        return parse(scan);
58
    }
60
    }
59
 
61