MCPcopy Create free account
hub / github.com/jOOQ/jOOQ / parseTXTLine

Method parseTXTLine

jOOQ/src/main/java/org/jooq/impl/Tools.java:5139–5155  ·  view source on GitHub ↗
(List<int[]> positions, List<String[]> result, String string, String nullLiteral)

Source from the content-addressed store, hash-verified

5137 }
5138
5139 private static final void parseTXTLine(List<int[]> positions, List<String[]> result, String string, String nullLiteral) {
5140 String[] fields = new String[positions.size()];
5141 result.add(fields);
5142 int length = string.length();
5143
5144 for (int i = 0; i < fields.length; i++) {
5145 int[] position = positions.get(i);
5146
5147 if (position[0] < length)
5148 fields[i] = string.substring(position[0], Math.min(position[1], length)).trim();
5149 else
5150 fields[i] = null;
5151
5152 if (StringUtils.equals(fields[i], nullLiteral))
5153 fields[i] = null;
5154 }
5155 }
5156
5157 private static final Pattern P_PARSE_HTML_ROW = Pattern.compile("<tr>(.*?)</tr>");
5158 private static final Pattern P_PARSE_HTML_COL_HEAD = Pattern.compile("<th>(.*?)</th>");

Callers 1

parseTXTLinesMethod · 0.95

Calls 8

equalsMethod · 0.95
sizeMethod · 0.65
addMethod · 0.65
lengthMethod · 0.65
getMethod · 0.65
trimMethod · 0.65
substringMethod · 0.65
minMethod · 0.65

Tested by

no test coverage detected