예제 #1
0
 @Override
 public void addError(AuditEvent evt) {
   if (evt.getSeverityLevel() != SeverityLevel.IGNORE) {
     writer.print("<error" + " line=\"" + evt.getLine() + "\"");
     if (evt.getColumn() > 0) {
       writer.print(" column=\"" + evt.getColumn() + "\"");
     }
     writer.print(" severity=\"" + evt.getSeverityLevel().getName() + "\"");
     writer.print(" message=\"" + encode(evt.getMessage()) + "\"");
     writer.println(" source=\"" + encode(evt.getSourceName()) + "\"/>");
   }
 }
예제 #2
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;
  }