/** * Attempts to locate a line that contains one of the markers * * @param lines The list of lines to scan - ignored if {@code null}/empty * @param markers The markers to match - ignored if {@code null}/empty * @return A {@link SimpleImmutableEntry} whose key is the <U>first</U> line index * that matched and value the matched marker index - {@code null} if no match found * @see #findMarkerLine(List, int, List) */ static SimpleImmutableEntry<Integer, Integer> findMarkerLine(List<String> lines, List<String> markers) { return findMarkerLine(lines, 0, markers); }
/** * Attempts to locate a line that contains one of the markers * * @param lines The list of lines to scan - ignored if {@code null}/empty * @param markers The markers to match - ignored if {@code null}/empty * @return A {@link SimpleImmutableEntry} whose key is the <U>first</U> line index * that matched and value the matched marker index - {@code null} if no match found * @see #findMarkerLine(List, int, List) */ static SimpleImmutableEntry<Integer, Integer> findMarkerLine(List<String> lines, List<String> markers) { return findMarkerLine(lines, 0, markers); }
static boolean containsMarkerLine(List<String> lines, List<String> markers) { return findMarkerLine(lines, markers) != null; }
static boolean containsMarkerLine(List<String> lines, List<String> markers) { return findMarkerLine(lines, markers) != null; }
List<String> beginMarkers = getBeginners(); List<List<String>> endMarkers = getEndingMarkers(); for (Map.Entry<Integer, Integer> markerPos = KeyPairResourceParser.findMarkerLine(lines, beginMarkers); markerPos != null;) { int startIndex = markerPos.getKey(); String startLine = lines.get(startIndex); markerPos = KeyPairResourceParser.findMarkerLine(lines, startIndex, ender); if (markerPos == null) { throw new StreamCorruptedException("Missing end marker (" + ender + ") after line #" + startIndex); markerPos = KeyPairResourceParser.findMarkerLine(lines, endIndex + 1, beginMarkers);
List<String> beginMarkers = getBeginners(); List<List<String>> endMarkers = getEndingMarkers(); for (Map.Entry<Integer, Integer> markerPos = KeyPairResourceParser.findMarkerLine(lines, beginMarkers); markerPos != null;) { int startIndex = markerPos.getKey(); String startLine = lines.get(startIndex); markerPos = KeyPairResourceParser.findMarkerLine(lines, startIndex, ender); if (markerPos == null) { throw new StreamCorruptedException("Missing end marker (" + ender + ") after line #" + startIndex); markerPos = KeyPairResourceParser.findMarkerLine(lines, endIndex + 1, beginMarkers);