/******************************************************************************* * Copyright (c) 2009, 2015 Mountainminds GmbH & Co. KG and Contributors * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Marc R. Hoffmann - initial API and implementation * *******************************************************************************/ package org.jacoco.report; import java.io.IOException; import org.jacoco.core.analysis.IBundleCoverage; /** * Output-Interface for hierarchical report structures. To allow sequential * processing and save memory the group structure has to be traversed in a * "deep first" fashion. The interface is implemented by the report formatters * and can be used to emit coverage report structures. * * The following constraints apply in using {@link IReportGroupVisitor} instances: * * */ public interface IReportGroupVisitor { /** * Called to add a bundle to the the report. * * @param bundle * a bundle to include in the report * @param locator * source locator for this bundle * @throws IOException * in case of IO problems with the report writer */ void visitBundle(IBundleCoverage bundle, ISourceFileLocator locator) throws IOException; /** * Called to add a new group to the report. The returned * {@link IReportGroupVisitor} instance can be used to add nested bundles or * groups. The content of the group has to be completed before this or any * parent visitor can be used again ("deep first"). * * @param name * name of the group * @return visitor for the group's content * @throws IOException * in case of IO problems with the report writer */ IReportGroupVisitor visitGroup(String name) throws IOException; }