Examples of TxtSplitType


Examples of datasoul.util.SwordHelper.TxtSplitType

            return;
        }
        String refs[] = listTxt.split(endl);

        ReferenceTxtType refStype = ReferenceTxtType.getRefTypeById(btp.getSelectedRefType());
        TxtSplitType splitType = TxtSplitType.getTxtSplitTypeById(btp.getSelectedHowToSplit());

        for (String reference : refs) {
            if (reference == null) {
                continue;
            }
            reference = reference.trim();
            if (reference.length() == 0) {
                return;
            }

            Key key = null;
            try {
                key = swordBook.getKey(reference);
            } catch (NoSuchKeyException ex) {
                Logger.getLogger(BibleVerseListPanel.class.getName()).log(Level.SEVERE, null, ex);
                continue;
            }
            String fullTxt = null;

            StringBuffer sb = new StringBuffer();

            int cardinality = key.getCardinality();
            String localBookName = null;
            for (int i = 0; i < cardinality; i++) {
                Key k = key.get(i);
                Verse v = KeyUtil.getVerse(k);
                if (localBookName == null) {
                    int bookNum = v.getBook();
                    try {
                        localBookName = BibleInfo.getPreferredBookName(bookNum);
                    } catch (NoSuchVerseException ex) {
                        Logger.getLogger(BibleVerseListPanel.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
                BookData data = new BookData(swordBook, k);

                try {
                    //The following line can throw a BookException
                    Element xmlData = data.getOsis();
                    fullTxt = OSISUtil.getCanonicalText(xmlData);

                    if (sb.length() > 0) {
                        sb.append(splitType.getTxt());
                    }
                    switch (refStype) {
                        case Full:
                            sb.append(localBookName).append(" ").append(v.getChapter()).append(":").append(v.getVerse()).append(" ");
                            break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.