Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.puppycrawl.tools.checkstyle
Class XMLLogger

    java.lang.Object
      com.puppycrawl.tools.checkstyle.api.AutomaticBean
          com.puppycrawl.tools.checkstyle.XMLLogger

All Implemented Interfaces:
  AuditListener, Configurable, Contextualizable, java.util.EventListener

public class XMLLogger
extends AutomaticBean
implements AuditListener

Simple XML logger. It outputs everything in UTF8 (default XML encoding is UTF8) in case we want to localize error messages or simply that filenames are localized and takes care about escaping as well.

Author:
  Stephane Bailliez

Constructor Summary
`XMLLogger(java.io.OutputStream aOS, boolean aCloseStream)` Creates a new `XMLLogger` instance.

Method Summary
`void` | `addError(AuditEvent aEvt)` Notify that an audit error was discovered on a specific file.
`void` | `addException(AuditEvent aEvt, java.lang.Throwable aThrowable)` Notify that an exception happened while performing audit.
`void` | `auditFinished(AuditEvent aEvt)` Notify that the audit is finished.
`void` | `auditStarted(AuditEvent aEvt)` Notify that the audit is about to start.
`java.lang.String` | `encode(java.lang.String aValue)` Escape <, > & ' and " as their entities.
`void` | `fileFinished(AuditEvent aEvt)` Notify that audit is finished on a specific file.
`void` | `fileStarted(AuditEvent aEvt)` Notify that audit is about to start on a specific file.
`boolean` | `isReference(java.lang.String aEnt)`

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean
`configure, contextualize, finishLocalSetup, getConfiguration, setupChild`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XMLLogger

    public XMLLogger(java.io.OutputStream aOS,
                     boolean aCloseStream)

  Creates a new `XMLLogger` instance. Sets the output to a defined stream.

Parameters:
  `aOS` - the stream to write logs to.
  `aCloseStream` - close aOS in auditFinished

Method Detail

### auditStarted

    public void auditStarted(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that the audit is about to start.

  Specified by:
    `auditStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### auditFinished

    public void auditFinished(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that the audit is finished.

  Specified by:
    `auditFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### fileStarted

    public void fileStarted(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that audit is about to start on a specific file.

  Specified by:
    `fileStarted` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### fileFinished

    public void fileFinished(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that audit is finished on a specific file.

  Specified by:
    `fileFinished` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### addError

    public void addError(AuditEvent aEvt)

  Description copied from interface: `AuditListener`
  Notify that an audit error was discovered on a specific file.

  Specified by:
    `addError` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
  See Also:
    `AuditListener`

### addException

    public void addException(AuditEvent aEvt,
                             java.lang.Throwable aThrowable)

  Description copied from interface: `AuditListener`
  Notify that an exception happened while performing audit.

  Specified by:
    `addException` in interface `AuditListener`
  Parameters:
    `aEvt` - the event details
    `aThrowable` - details of the exception
  See Also:
    `AuditListener`

### encode

    public java.lang.String encode(java.lang.String aValue)

  Escape <, > & ' and " as their entities.

  Parameters:
    `aValue` - the value to escape.
  Returns:
    the escaped value if necessary.

### isReference

    public boolean isReference(java.lang.String aEnt)

  Parameters:
    `aEnt` - the possible entity to look for.
  Returns:
    whether the given argument a character or entity reference

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Back to the Checkstyle Home Page
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD