1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one * 3 * or more contributor license agreements. See the NOTICE file * 4 * distributed with this work for additional information * 5 * regarding copyright ownership. The ASF licenses this file * 6 * to you under the Apache License, Version 2.0 (the * 7 * "License"); you may not use this file except in compliance * 8 * with the License. You may obtain a copy of the License at * 9 * * 10 * http://www.apache.org/licenses/LICENSE-2.0 * 11 * * 12 * Unless required by applicable law or agreed to in writing, * 13 * software distributed under the License is distributed on an * 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * 15 * KIND, either express or implied. See the License for the * 16 * specific language governing permissions and limitations * 17 * under the License. * 18 */ 19 package org.apache.rat; 20 21 import org.apache.rat.analysis.IHeaderMatcher; 22 import org.apache.rat.license.ILicenseFamily; 23 24 25 /** 26 * A configuration object is used by the frontend to invoke the 27 * {@link Report}. Basically, the sole purpose of the frontends is 28 * to create the configuration and invoke the {@link Report}. 29 */ 30 public class ReportConfiguration { 31 private IHeaderMatcher headerMatcher; 32 private ILicenseFamily[] approvedLicenseNames; 33 private boolean addingLicenses; 34 private boolean addingLicensesForced; 35 private String copyrightMessage; 36 37 /** 38 * Returns the header matcher. 39 */ 40 public IHeaderMatcher getHeaderMatcher() { 41 return headerMatcher; 42 } 43 44 /** 45 * Sets the header matcher. 46 */ 47 public void setHeaderMatcher(IHeaderMatcher headerMatcher) { 48 this.headerMatcher = headerMatcher; 49 } 50 51 /** 52 * Returns the set of approved license names. 53 */ 54 public ILicenseFamily[] getApprovedLicenseNames() { 55 return approvedLicenseNames; 56 } 57 58 /** 59 * Sets the set of approved license names. 60 */ 61 public void setApprovedLicenseNames(ILicenseFamily[] approvedLicenseNames) { 62 this.approvedLicenseNames = approvedLicenseNames; 63 } 64 65 /** 66 * If RAT is adding license headers: Returns the optional 67 * copyright message. This value is ignored, if no 68 * license headers are added. 69 * @see #isAddingLicenses() 70 */ 71 public String getCopyrightMessage() { 72 return copyrightMessage; 73 } 74 75 /** 76 * If RAT is adding license headers: Sets the optional 77 * copyright message. This value is ignored, if no 78 * license headers are added. 79 * @see #setAddingLicenses(boolean) 80 */ 81 public void setCopyrightMessage(String copyrightMessage) { 82 this.copyrightMessage = copyrightMessage; 83 } 84 85 /** 86 * If RAT is adding license headers: Returns, whether adding 87 * license headers is enforced. This value is ignored, if no 88 * license headers are added. 89 * @see #isAddingLicenses() 90 */ 91 public boolean isAddingLicensesForced() { 92 return addingLicensesForced; 93 } 94 95 /** 96 * If RAT is adding license headers: Sets, whether adding 97 * license headers is enforced. This value is ignored, if no 98 * license headers are added. 99 * @see #isAddingLicenses() 100 */ 101 public void setAddingLicensesForced(boolean addingLicensesForced) { 102 this.addingLicensesForced = addingLicensesForced; 103 } 104 105 /** 106 * Returns, whether RAT should add missing license headers. 107 * @see #isAddingLicensesForced() 108 * @see #getCopyrightMessage() 109 */ 110 public boolean isAddingLicenses() { 111 return addingLicenses; 112 } 113 114 /** 115 * Returns, whether RAT should add missing license headers. 116 * @see #setAddingLicensesForced(boolean) 117 * @see #setCopyrightMessage(String) 118 */ 119 public void setAddingLicenses(boolean addingLicenses) { 120 this.addingLicenses = addingLicenses; 121 } 122 123 124 }