Exemplo n.º 1
0
 public void setFilterPattern(String filterPattern, boolean noRegex) {
   this.noRegex = noRegex;
   this.givenFilterPattern = filterPattern;
   patternBuilder = new StringBuilder("(?ms)");
   extractPatternParts(noRegex ? Pattern.quote(filterPattern) : filterPattern);
   this.filterPattern = Pattern.compile(patternBuilder.toString());
 }
Exemplo n.º 2
0
  /**
   * Appends to current pattern new part which is could be a thread coupling pattern or just a
   * different thing to look up in the data.
   *
   * @param val pattern to be added
   * @param qualifier identifies how to conjunct it with previous patterns
   */
  protected void addExtendedFilterPattern(String val, String qualifier) {
    if (LOGGER.isTraceEnabled())
      LOGGER.trace("adding complex pattern: val={} qual={}", val, qualifier);

    if (qualifier != null)
      patternBuilder = patternBuilder.append(Qualifier.valueOf(qualifier).getPattern());
    patternBuilder = patternBuilder.append("(?:").append(val).append(")");

    if (LOGGER.isTraceEnabled()) {
      LOGGER.trace("Built so far: {}", patternBuilder.toString());
    }
  }