Пример #1
0
  /** {@inheritDoc} */
  public boolean accept(AuditEvent aEvent) {
    // file and check match?
    if ((aEvent.getFileName() == null)
        || !mFileRegexp.matcher(aEvent.getFileName()).find()
        || (aEvent.getLocalizedMessage() == null)
        || ((mModuleId != null) && !mModuleId.equals(aEvent.getModuleId()))
        || ((mCheckRegexp != null) && !mCheckRegexp.matcher(aEvent.getSourceName()).find())) {
      return true;
    }

    // reject if no line/column matching
    if ((mLineFilter == null) && (mColumnFilter == null)) {
      return false;
    }

    // reject if line matches a line CSV value.
    if (mLineFilter != null) {
      if (mLineFilter.accept(aEvent.getLine())) {
        return false;
      }
    }

    // reject if column matches a column CSV value.
    if (mColumnFilter != null) {
      if (mColumnFilter.accept(aEvent.getColumn())) {
        return false;
      }
    }
    return true;
  }
Пример #2
0
 @Override
 public void fileStarted(AuditEvent evt) {
   writer.println("<file name=\"" + encode(evt.getFileName()) + "\">");
 }
 @Test
 public void testDecideDefault() {
   final AuditEvent ev = new AuditEvent(this, "Test.java");
   assertTrue(ev.getFileName(), filter.accept(ev));
 }