diff options
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r-- | src/main/java/org/traccar/helper/Parser.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/helper/Parser.java b/src/main/java/org/traccar/helper/Parser.java index aa39e1ad7..c2aea28fa 100644 --- a/src/main/java/org/traccar/helper/Parser.java +++ b/src/main/java/org/traccar/helper/Parser.java @@ -50,6 +50,17 @@ public class Parser { public boolean hasNext(int number) { for (int i = position; i < position + number; i++) { String value = matcher.group(i); + if (value == null || value.isEmpty()) { + position += number; + return false; + } + } + return true; + } + + public boolean hasNextAny(int number) { + for (int i = position; i < position + number; i++) { + String value = matcher.group(i); if (value != null && !value.isEmpty()) { return true; } |