final StringTokenizer line = new StringTokenizer(source, NEW_LINE); while (line.hasMoreTokens()) { final StringTokenizer element = new StringTokenizer(line.nextToken(), ELEMENT_SEPARATOR); if (element.countTokens() != MAX_NUMBER_OF_ELEMENTS) { return null; } bibliographicReferences.createBibliographicReference(element.nextToken(), element .nextToken(), element.nextToken(), element.nextToken(), element.nextToken(), BibliographicReferenceType.valueOf(element.nextToken()), Integer.valueOf(element .nextToken())); }
fillBibliographicReferences(bibliographicReferences, source);
    private BibliographicReferences read(String source) {        final BibliographicReferences bibliographicReferences = new BibliographicReferences();        final StringTokenizer line = new StringTokenizer(source, NEW_LINE);        while (line.hasMoreTokens()) {            final StringTokenizer element = new StringTokenizer(line.nextToken(), ELEMENT_SEPARATOR);            if (element.countTokens() != MAX_NUMBER_OF_ELEMENTS) {                return null; // invalid data (must correct first)            }            bibliographicReferences.createBibliographicReference(element.nextToken(), element                    .nextToken(), element.nextToken(), element.nextToken(), element.nextToken(),                    BibliographicReferenceType.valueOf(element.nextToken()), Integer.valueOf(element                            .nextToken()));        }        return bibliographicReferences;    }