Package org.jacoco.report.internal.xml

Examples of org.jacoco.report.internal.xml.XMLDocument


   * @throws IOException
   *             in case of problems with the output stream
   */
  public IReportVisitor createVisitor(final OutputStream output)
      throws IOException {
    final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
        outputEncoding, true, output);
    class RootVisitor extends XMLGroupVisitor implements IReportVisitor {

      RootVisitor(final XMLElement element) throws IOException {
        super(element, null);
      }

      private List<SessionInfo> sessionInfos;

      public void visitInfo(final List<SessionInfo> sessionInfos,
          final Collection<ExecutionData> executionData)
          throws IOException {
        this.sessionInfos = sessionInfos;
      }

      @Override
      protected void handleBundle(final IBundleCoverage bundle,
          final ISourceFileLocator locator) throws IOException {
        writeHeader(bundle.getName());
        XMLCoverageWriter.writeBundle(bundle, element);
      }

      @Override
      protected AbstractGroupVisitor handleGroup(final String name)
          throws IOException {
        writeHeader(name);
        return new XMLGroupVisitor(element, name);
      }

      private void writeHeader(final String name) throws IOException {
        element.attr("name", name);
        for (final SessionInfo i : sessionInfos) {
          final XMLElement sessioninfo = root.element("sessioninfo");
          sessioninfo.attr("id", i.getId());
          sessioninfo.attr("start", i.getStartTimeStamp());
          sessioninfo.attr("dump", i.getDumpTimeStamp());
        }
      }
View Full Code Here


   * @throws IOException
   *             in case of problems with the output stream
   */
  public IReportVisitor createVisitor(final OutputStream output)
      throws IOException {
    final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
        outputEncoding, true, output);
    class RootVisitor extends XMLGroupVisitor implements IReportVisitor {

      RootVisitor(final XMLElement element) throws IOException {
        super(element, null);
      }

      private List<SessionInfo> sessionInfos;

      public void visitInfo(final List<SessionInfo> sessionInfos,
          final Collection<ExecutionData> executionData)
          throws IOException {
        this.sessionInfos = sessionInfos;
      }

      @Override
      protected void handleBundle(final IBundleCoverage bundle,
          final ISourceFileLocator locator) throws IOException {
        writeHeader(bundle.getName());
        XMLCoverageWriter.writeBundle(bundle, element);
      }

      @Override
      protected AbstractGroupVisitor handleGroup(final String name)
          throws IOException {
        writeHeader(name);
        return new XMLGroupVisitor(element, name);
      }

      private void writeHeader(final String name) throws IOException {
        element.attr("name", name);
        for (final SessionInfo i : sessionInfos) {
          final XMLElement sessioninfo = root.element("sessioninfo");
          sessioninfo.attr("id", i.getId());
          sessioninfo.attr("start", i.getStartTimeStamp());
          sessioninfo.attr("dump", i.getDumpTimeStamp());
        }
      }
View Full Code Here

      final Collection<ExecutionData> executionData) throws IOException {

    if (output == null) {
      throw new IllegalStateException("No report output set.");
    }
    final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
        outputEncoding, true, output.createFile());
    return new XMLReportNodeHandler(root, rootNode) {
      @Override
      protected void insertElementsBefore(final XMLElement element)
          throws IOException {
View Full Code Here

   * @throws IOException
   *             in case of problems with the output stream
   */
  public IReportVisitor createVisitor(final OutputStream output)
      throws IOException {
    final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
        outputEncoding, true, output);
    class RootVisitor extends XMLGroupVisitor implements IReportVisitor {

      RootVisitor(final XMLElement element) throws IOException {
        super(element, null);
      }

      private List<SessionInfo> sessionInfos;

      public void visitInfo(final List<SessionInfo> sessionInfos,
          final Collection<ExecutionData> executionData)
          throws IOException {
        this.sessionInfos = sessionInfos;
      }

      @Override
      protected void handleBundle(final IBundleCoverage bundle,
          final ISourceFileLocator locator) throws IOException {
        writeHeader(bundle.getName());
        XMLCoverageWriter.writeBundle(bundle, element);
      }

      @Override
      protected AbstractGroupVisitor handleGroup(final String name)
          throws IOException {
        writeHeader(name);
        return new XMLGroupVisitor(element, name);
      }

      private void writeHeader(final String name) throws IOException {
        element.attr("name", name);
        for (final SessionInfo i : sessionInfos) {
          final XMLElement sessioninfo = root.element("sessioninfo");
          sessioninfo.attr("id", i.getId());
          sessioninfo.attr("start", i.getStartTimeStamp());
          sessioninfo.attr("dump", i.getDumpTimeStamp());
        }
      }
View Full Code Here

   * @throws IOException
   *             in case of problems with the output stream
   */
  public IReportVisitor createVisitor(final OutputStream output)
      throws IOException {
    final XMLElement root = new XMLDocument("report", PUBID, SYSTEM,
        outputEncoding, true, output);
    class RootVisitor extends XMLGroupVisitor implements IReportVisitor {

      RootVisitor(final XMLElement element) throws IOException {
        super(element, null);
      }

      private List<SessionInfo> sessionInfos;

      public void visitInfo(final List<SessionInfo> sessionInfos,
          final Collection<ExecutionData> executionData)
          throws IOException {
        this.sessionInfos = sessionInfos;
      }

      @Override
      protected void handleBundle(final IBundleCoverage bundle,
          final ISourceFileLocator locator) throws IOException {
        writeHeader(bundle.getName());
        XMLCoverageWriter.writeBundle(bundle, element);
      }

      @Override
      protected AbstractGroupVisitor handleGroup(final String name)
          throws IOException {
        writeHeader(name);
        return new XMLGroupVisitor(element, name);
      }

      private void writeHeader(final String name) throws IOException {
        element.attr("name", name);
        for (final SessionInfo i : sessionInfos) {
          final XMLElement sessioninfo = root.element("sessioninfo");
          sessioninfo.attr("id", i.getId());
          sessioninfo.attr("start", i.getStartTimeStamp());
          sessioninfo.attr("dump", i.getDumpTimeStamp());
        }
      }
View Full Code Here

TOP

Related Classes of org.jacoco.report.internal.xml.XMLDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.