private void checkend(IParserCallback parserCallback, StringBuilder StringBuilder, String line, GenericWrapper<Integer> apostrophesWrapper ) { String trimmedline = line.trim(); if ( !trimmedline.isEmpty() && !trimmedline.startsWith("--") ) { if ( line.contains(";") ) { String[] splitted = line.split(";"); int position = 0; for (int i=0 ; i<splitted.length; i++) { int apostrophes = apostrophesWrapper.getValue(); String token = splitted[i]; position += token.length() + 1; apostrophes += countApostrophes(token); apostrophesWrapper.setValue(apostrophes); if ( apostrophes % 2 == 1) { StringBuilder.append(token + ";"); } else { StringBuilder.append(token); parserCallback.parseAction(StringBuilder.toString()); StringBuilder.setLength(0); apostrophesWrapper.setValue(0); line = line.substring(position, line.length() ); checkend(parserCallback, StringBuilder, line, apostrophesWrapper); break; } } } else { StringBuilder.append(line + "\n"); } } }
private void checkend(final ParserCallback parserCallback, final StringBuilder StringBuilder, final String line, final GenericWrapper<Integer> apostrophesWrapper ) { String trimmedline = line.trim(); if ( !trimmedline.isEmpty() && !trimmedline.startsWith("--") ) { //$NON-NLS-1$ if ( line.contains(";") ) { //$NON-NLS-1$ String tempLine = line; String[] splitted = tempLine.split(";"); //$NON-NLS-1$ int position = 0; for (String token : splitted) { int apostrophes = apostrophesWrapper.getValue(); position += token.length() + 1; apostrophes += countApostrophes(token); apostrophesWrapper.setValue(apostrophes); if ( (apostrophes % 2) == 1) { StringBuilder.append(token + ";"); //$NON-NLS-1$ } else { StringBuilder.append(token); parserCallback.parseAction(StringBuilder.toString()); StringBuilder.setLength(0); apostrophesWrapper.setValue(0); tempLine = tempLine.substring(position, tempLine.length() ); checkend(parserCallback, StringBuilder, tempLine, apostrophesWrapper); break; } } } else { StringBuilder.append(line + "\n"); //$NON-NLS-1$ } } }