org.jcoderz.phoenix.report
Class JcoderzReport

java.lang.Object
  extended by org.jcoderz.phoenix.report.AbstractReportReader
      extended by org.jcoderz.phoenix.report.JcoderzReport
All Implemented Interfaces:
ValidationEventHandler, ReportReader

public final class JcoderzReport
extends AbstractReportReader

This class implements writing of jcoderz-report.xml files.

Author:
Michael Griffel

Field Summary
static String JCODERZ_JAXB_CONTEXT_PATH
          JAXB context path.
 
Method Summary
 void addItems(ReportLevel level, Map<ResourceInfo,List<Item>> items)
          Just add items of a specific level to the report, do not write the file to persistent storage yet.
 void addSystemLevelIssue(String message, Throwable e, ResourceInfo res)
           
 Map getItems()
          Returns the items of the input report as a Map of filename string and of the type Item (org.jcoderz.phoenix.report.jaxb.Item).
 String getProjectHome()
          Gets the project's home folder.
 String getProjectName()
          Gets the project name.
 void parse(File f)
          Parses the report file/directory.
 void setLevel(ReportLevel level)
          Sets the report level.
 void setProjectHome(String s)
          Sets the project's home folder.
 void setProjectName(String s)
          Sets the project name.
 void write(OutputStream out, Map<ResourceInfo,List<Item>> items)
          Writes the report to the specified stream by using JAXB.
 void writeReport(OutputStream out)
          Write the report to persistent storage.
 
Methods inherited from class org.jcoderz.phoenix.report.AbstractReportReader
getMarshaller, getUnmarshaller, handleEvent, merge, normalizeFileName, unmarshall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JCODERZ_JAXB_CONTEXT_PATH

public static final String JCODERZ_JAXB_CONTEXT_PATH
JAXB context path.

See Also:
Constant Field Values
Method Detail

getItems

public Map getItems()
             throws JAXBException
Returns the items of the input report as a Map of filename string and of the type Item (org.jcoderz.phoenix.report.jaxb.Item).

Specified by:
getItems in class AbstractReportReader
Returns:
the items of the input report as a List of the type Item.
Throws:
JAXBException - if an JAXB exception occures.

setLevel

public void setLevel(ReportLevel level)
Sets the report level.

Parameters:
level - The level of the report

parse

public void parse(File f)
           throws JAXBException
Parses the report file/directory.

Parameters:
f - input XML report or directory.
Throws:
JAXBException - if an JAXB exception occures.

write

public void write(OutputStream out,
                  Map<ResourceInfo,List<Item>> items)
           throws JAXBException
Writes the report to the specified stream by using JAXB.

Parameters:
out - where to write the jCoderZ report to.
items - the file items. The items are a Map of ResourceInfo and a List of the type jCoderZ Item (org.jcoderz.phoenix.report.jaxb.Item)
Throws:
JAXBException - for JAXB errors

addItems

public void addItems(ReportLevel level,
                     Map<ResourceInfo,List<Item>> items)
              throws JAXBException
Just add items of a specific level to the report, do not write the file to persistent storage yet.

Parameters:
level - The level under which to add the items.
items - A map of items.
Throws:
JAXBException - When the JAXB file representation can not be created.

writeReport

public void writeReport(OutputStream out)
                 throws JAXBException
Write the report to persistent storage.

Parameters:
out - The output stream to write the report to.
Throws:
JAXBException - In case a marshalling exception occurs.

setProjectHome

public void setProjectHome(String s)
Sets the project's home folder.

Parameters:
s - the home folder

getProjectHome

public String getProjectHome()
Gets the project's home folder.

Returns:
the home folder

setProjectName

public void setProjectName(String s)
Sets the project name.

Parameters:
s - the name of the project

getProjectName

public String getProjectName()
Gets the project name.

Returns:
the name of the project

addSystemLevelIssue

public void addSystemLevelIssue(String message,
                                Throwable e,
                                ResourceInfo res)


Copyright 2007 The jCoderZ Project.