org.scribble.common.logging
Class CachedJournal

java.lang.Object
  extended by org.scribble.common.logging.CachedJournal
All Implemented Interfaces:
Journal

public class CachedJournal
extends Object
implements Journal

This class provides an implementation of the journal that caches reported issues.


Nested Class Summary
 class CachedJournal.IssueDetails
          This class represents the issue details.
static class CachedJournal.IssueType
          This enum represents the type of issue.
 
Field Summary
 
Fields inherited from interface org.scribble.common.logging.Journal
END_COLUMN, END_LINE, END_POSITION, RESOURCE_URL, START_COLUMN, START_LINE, START_POSITION
 
Constructor Summary
CachedJournal()
           
 
Method Summary
 void apply(Journal logger)
          This method applies any cached issues to the supplied logger.
 void error(String issue, Map<String,Object> props)
          This method records an error issue.
 List<CachedJournal.IssueDetails> getIssues()
          This method returns the list of issues that have been reported to this journal.
 boolean hasErrors()
          This method determines whether any errors have been reported.
 boolean hasWarnings()
          This method determines whether any warnings have been reported.
 void info(String issue, Map<String,Object> props)
          This method records an information issue.
 void warning(String issue, Map<String,Object> props)
          This method records a warning issue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedJournal

public CachedJournal()
Method Detail

error

public void error(String issue,
                  Map<String,Object> props)
This method records an error issue.

Specified by:
error in interface Journal
Parameters:
issue - The issue text
props - The optional properties associated with the issue

info

public void info(String issue,
                 Map<String,Object> props)
This method records an information issue.

Specified by:
info in interface Journal
Parameters:
issue - The issue text
props - The optional properties associated with the issue

warning

public void warning(String issue,
                    Map<String,Object> props)
This method records a warning issue.

Specified by:
warning in interface Journal
Parameters:
issue - The issue text
props - The optional properties associated with the issue

getIssues

public List<CachedJournal.IssueDetails> getIssues()
This method returns the list of issues that have been reported to this journal.

Returns:
The list of issues

hasErrors

public boolean hasErrors()
This method determines whether any errors have been reported.

Returns:
Whether errors have been reported

hasWarnings

public boolean hasWarnings()
This method determines whether any warnings have been reported.

Returns:
Whether warnings have been reported

apply

public void apply(Journal logger)
This method applies any cached issues to the supplied logger.

Parameters:
logger - The logger


Copyright © 2008-Present Scribble.org. All Rights Reserved.