de.smartics.analysis.javadoc.log
Class JavadocMessageLogger

Package class diagram package JavadocMessageLogger
java.lang.Object
  extended by de.smartics.analysis.javadoc.log.JavadocMessageLogger

public class JavadocMessageLogger
     
     
extends Object

Helper to collect errors, warnings and notices from the Javadoc tool.

Author:
Robert Reiner

Constructor Summary
JavadocMessageLogger()
          Default constructor.
JavadocMessageLogger(PrintWriter errWriter, PrintWriter warnWriter, PrintWriter noticeWriter)
          Constructor to pass pre-configured writers to the instance.
 
Method Summary
 List<IssueMessage> getErrMessages()
          Returns the collected error messages.
 PrintWriter getErrWriter()
          Returns the writer to be notified about errors encountered by the Javadoc tool.
 List<IssueMessage> getNoticeMessages()
          Returns the collected notice messages.
 PrintWriter getNoticeWriter()
          Returns the writer to be notified about notices made by the Javadoc tool.
 int getReturnCode()
          Returns the return code reported by the Javadoc tool.
 List<IssueMessage> getWarnMessages()
          Returns the collected warn messages.
 PrintWriter getWarnWriter()
          Returns the writer to be notified about warnings encountered by the Javadoc tool.
 boolean hasMessages(boolean considerNoticeMessages)
          Checks if there are messages logged.
 void setReturnCode(int returnCode)
          Sets the return code reported by the Javadoc tool.
 String toString()
          Returns the string representation of the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JavadocMessageLogger

public JavadocMessageLogger(PrintWriter errWriter,
                            PrintWriter warnWriter,
                            PrintWriter noticeWriter)
Constructor to pass pre-configured writers to the instance.

Parameters:
errWriter - the writer to be notified about errors encountered by the Javadoc tool.
warnWriter - the writer to be notified about warnings encountered by the Javadoc tool.
noticeWriter - the writer to be notified about notices made by the Javadoc tool.

JavadocMessageLogger

public JavadocMessageLogger()
Default constructor.

Method Detail

getReturnCode

public int getReturnCode()
Returns the return code reported by the Javadoc tool.

Returns:
the return code reported by the Javadoc tool.

setReturnCode

public void setReturnCode(int returnCode)
Sets the return code reported by the Javadoc tool.

Parameters:
returnCode - the return code reported by the Javadoc tool.

getErrWriter

public PrintWriter getErrWriter()
Returns the writer to be notified about errors encountered by the Javadoc tool.

Returns:
the writer to be notified about errors encountered by the Javadoc tool.

getWarnWriter

public PrintWriter getWarnWriter()
Returns the writer to be notified about warnings encountered by the Javadoc tool.

Returns:
the writer to be notified about warnings encountered by the Javadoc tool.

getNoticeWriter

public PrintWriter getNoticeWriter()
Returns the writer to be notified about notices made by the Javadoc tool.

Returns:
the writer to be notified about notices made by the Javadoc tool.

getErrMessages

public List<IssueMessage> getErrMessages()
Returns the collected error messages.

Returns:
the collected error messages.

getWarnMessages

public List<IssueMessage> getWarnMessages()
Returns the collected warn messages.

Returns:
the collected warn messages.

getNoticeMessages

public List<IssueMessage> getNoticeMessages()
Returns the collected notice messages.

Returns:
the collected notice messages.

hasMessages

public boolean hasMessages(boolean considerNoticeMessages)
Checks if there are messages logged.

Parameters:
considerNoticeMessages - if set to true notice messages are checked, too. If false only error and warn messages are checked to be not empty.
Returns:
true if at least one message has been logged, false otherwise.

toString

public String toString()
Returns the string representation of the object.

Overrides:
toString in class Object
Returns:
the string representation of the object.


Copyright © 2008-2011 Kronseder & Reiner GmbH - smartics. All Rights Reserved.