Package org.apache.rat

Examples of org.apache.rat.ReportConfiguration


     * @throws InterruptedException
     * @throws TransformerException
     * @throws RatException
     */
    private void createReport(PrintWriter out) throws IOException, TransformerException, InterruptedException, RatException {
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher(new HeaderMatcherMultiplexer(getLicenseMatchers()));
        configuration.setApprovedLicenseNames(getApprovedLicenseNames());
       
        if (AddLicenseHeaders.FORCED.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            configuration.setAddingLicenses(true);
            configuration.setAddingLicensesForced(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if (AddLicenseHeaders.TRUE.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            configuration.setAddingLicenses(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if (!AddLicenseHeaders.FALSE.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            throw new BuildException("Invalid value for addLicenseHeaders: " + addLicenseHeaders.getValue());
        }
        ResourceCollectionContainer rcElement = new ResourceCollectionContainer(nestedResources);
        if (format.getValue().equals(Format.XML_KEY)) {
View Full Code Here


        }
    }

    protected ReportConfiguration getConfiguration()
            throws MojoFailureException, MojoExecutionException {
        final ReportConfiguration configuration = super.getConfiguration();
        if ("forced".equals(addLicenseHeaders)) {
            configuration.setAddingLicenses(true);
            configuration.setAddingLicensesForced(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if ("true".equals(addLicenseHeaders)) {
            configuration.setAddingLicenses(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if ("false".equals(addLicenseHeaders)) {
            // Nothing to do
        } else {
            throw new MojoFailureException("Invalid value for addLicenseHeaders: Expected forced|true|false, got "
                    + addLicenseHeaders);
View Full Code Here

     * @throws MojoExecutionException
     *             Another error occurred while creating the report.
     */
    protected ClaimStatistic createReport( Writer out, InputStream style ) throws MojoExecutionException, MojoFailureException
    {
        final ReportConfiguration configuration = getConfiguration();
        try
        {
            if (style != null) {
                return Report.report( out, getResources(), style, configuration );
            } else {
View Full Code Here

        }
    }

    protected ReportConfiguration getConfiguration() throws MojoFailureException,
            MojoExecutionException {
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher( new HeaderMatcherMultiplexer( getLicenseMatchers() ) );
        configuration.setApprovedLicenseNames(getApprovedLicenseNames());
        return configuration;
    }
View Full Code Here

    public void testStandardReport() throws Exception {
      final String elementsPath = Resources.getResourceDirectory("elements/Source.java");
        final MockLicenseMatcher mockLicenseMatcher = new MockLicenseMatcher();
        DirectoryWalker directory = new DirectoryWalker(new File(elementsPath), IGNORE_EMPTY);
        final ClaimStatistic statistic = new ClaimStatistic();
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher(mockLicenseMatcher);
        RatReport report = XmlReportFactory.createStandardReport(writer, statistic, configuration);
        report.startReport();
        report(directory, report);
        report.endReport();
        writer.closeDocument();
View Full Code Here

     * @throws InterruptedException
     * @throws TransformerException
     * @throws RatException
     */
    private void createReport(PrintWriter out) throws IOException, TransformerException, InterruptedException, RatException {
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher(new HeaderMatcherMultiplexer(getLicenseMatchers()));
        configuration.setApprovedLicenseNames(getApprovedLicenseNames());
       
        if (AddLicenseHeaders.FORCED.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            configuration.setAddingLicenses(true);
            configuration.setAddingLicensesForced(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if (AddLicenseHeaders.TRUE.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            configuration.setAddingLicenses(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if (!AddLicenseHeaders.FALSE.equalsIgnoreCase(addLicenseHeaders.getValue())) {
            throw new BuildException("Invalid value for addLicenseHeaders: " + addLicenseHeaders.getValue());
        }
        ResourceCollectionContainer rcElement = new ResourceCollectionContainer(nestedResources);
        if (format.getValue().equals(Format.XML_KEY)) {
View Full Code Here

     * @throws MojoExecutionException
     *             Another error occurred while creating the report.
     */
    protected ClaimStatistic createReport( Writer out, InputStream style ) throws MojoExecutionException, MojoFailureException
    {
        final ReportConfiguration configuration = getConfiguration();
        try
        {
            if (style != null) {
                return Report.report( out, getResources(), style, configuration );
            } else {
View Full Code Here

        }
    }

    protected ReportConfiguration getConfiguration() throws MojoFailureException,
            MojoExecutionException {
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher( new HeaderMatcherMultiplexer( getLicenseMatchers() ) );
        configuration.setApprovedLicenseNames(getApprovedLicenseNames());
        return configuration;
    }
View Full Code Here

    public void testStandardReport() throws Exception {
      final String elementsPath = Resources.getResourceDirectory("elements/Source.java");
        final MockLicenseMatcher mockLicenseMatcher = new MockLicenseMatcher();
        DirectoryWalker directory = new DirectoryWalker(new File(elementsPath), IGNORE_EMPTY);
        final ClaimStatistic statistic = new ClaimStatistic();
        final ReportConfiguration configuration = new ReportConfiguration();
        configuration.setHeaderMatcher(mockLicenseMatcher);
        RatReport report = XmlReportFactory.createStandardReport(writer, statistic, configuration);
        report.startReport();
        report(directory, report);
        report.endReport();
        writer.closeDocument();
View Full Code Here

    }

    @Override
    protected ReportConfiguration getConfiguration()
            throws MojoFailureException, MojoExecutionException {
        final ReportConfiguration configuration = super.getConfiguration();
        if ("forced".equals(addLicenseHeaders)) {
            configuration.setAddingLicenses(true);
            configuration.setAddingLicensesForced(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if ("true".equals(addLicenseHeaders)) {
            configuration.setAddingLicenses(true);
            configuration.setCopyrightMessage(copyrightMessage);
        } else if ("false".equals(addLicenseHeaders)) {
            // Nothing to do
        } else {
            throw new MojoFailureException("Invalid value for addLicenseHeaders: Expected forced|true|false, got "
                    + addLicenseHeaders);
View Full Code Here

TOP

Related Classes of org.apache.rat.ReportConfiguration

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.