Exemple #1
0
 private NaturalLanguageMethodMatch match(
     NaturalLanguageMethod naturalLanguageMethod, String inputString) {
   if (LOGGER.isLoggable(Level.FINEST)) {
     LOGGER.log(
         Level.FINEST,
         "Checking "
             + naturalLanguageMethod.getPattern()
             + " for match with '"
             + inputString
             + "'");
   }
   Matcher matcher = naturalLanguageMethod.getPattern().matcher(inputString);
   if (matcher.matches()) {
     return new NaturalLanguageMethodMatch(naturalLanguageMethod, matcher);
   }
   return null;
 }
Exemple #2
0
 private boolean isCatchAllMethod(NaturalLanguageMethod method) {
   return method.getPattern().pattern().equals(EVERYTHING_ELSE_REGEX);
 }