1 package com.github.triceo.splitlog.splitters.exceptions;
2
3 import java.util.regex.Matcher;
4
5 class SubCauseParser extends ExceptionLineParser<CauseLine> {
6
7 @Override
8 public CauseLine parse(final String line) {
9 final String regex = "^Caused by: (" + ExceptionLineParser.JAVA_FQN_REGEX + ")(: (.*))?$";
10 final Matcher m = this.getMatcher(regex, line);
11 if (!m.matches()) {
12 return null;
13 }
14 return new CauseLine(m.group(1), m.group(4));
15 }
16
17 }