Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added support for adding license headers to the Maven plugin and the Ant tasks. - Refactoring and code simplification. git-svn-id: https://svn.apache.org/repos/asf/incubator/rat/main/trunk@963778 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information
Showing
26 changed files
with
591 additions
and
290 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
apache-rat-core/src/main/java/org/apache/rat/ReportConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
package org.apache.rat; | ||
|
||
import org.apache.rat.analysis.IHeaderMatcher; | ||
import org.apache.rat.license.ILicenseFamily; | ||
|
||
|
||
/** | ||
* A configuration object is used by the frontend to invoke the | ||
* {@link Report}. Basically, the sole purpose of the frontends is | ||
* to create the configuration and invoke the {@link Report}. | ||
*/ | ||
public class ReportConfiguration { | ||
private IHeaderMatcher headerMatcher; | ||
private ILicenseFamily[] approvedLicenseNames; | ||
private boolean addingLicenses; | ||
private boolean addingLicensesForced; | ||
private String copyrightMessage; | ||
|
||
/** | ||
* Returns the header matcher. | ||
*/ | ||
public IHeaderMatcher getHeaderMatcher() { | ||
return headerMatcher; | ||
} | ||
|
||
/** | ||
* Sets the header matcher. | ||
*/ | ||
public void setHeaderMatcher(IHeaderMatcher headerMatcher) { | ||
this.headerMatcher = headerMatcher; | ||
} | ||
|
||
/** | ||
* Returns the set of approved license names. | ||
*/ | ||
public ILicenseFamily[] getApprovedLicenseNames() { | ||
return approvedLicenseNames; | ||
} | ||
|
||
/** | ||
* Sets the set of approved license names. | ||
*/ | ||
public void setApprovedLicenseNames(ILicenseFamily[] approvedLicenseNames) { | ||
this.approvedLicenseNames = approvedLicenseNames; | ||
} | ||
|
||
/** | ||
* If RAT is adding license headers: Returns the optional | ||
* copyright message. This value is ignored, if no | ||
* license headers are added. | ||
* @see #isAddingLicenses() | ||
*/ | ||
public String getCopyrightMessage() { | ||
return copyrightMessage; | ||
} | ||
|
||
/** | ||
* If RAT is adding license headers: Sets the optional | ||
* copyright message. This value is ignored, if no | ||
* license headers are added. | ||
* @see #setAddingLicenses(boolean) | ||
*/ | ||
public void setCopyrightMessage(String copyrightMessage) { | ||
this.copyrightMessage = copyrightMessage; | ||
} | ||
|
||
/** | ||
* If RAT is adding license headers: Returns, whether adding | ||
* license headers is enforced. This value is ignored, if no | ||
* license headers are added. | ||
* @see #isAddingLicenses() | ||
*/ | ||
public boolean isAddingLicensesForced() { | ||
return addingLicensesForced; | ||
} | ||
|
||
/** | ||
* If RAT is adding license headers: Sets, whether adding | ||
* license headers is enforced. This value is ignored, if no | ||
* license headers are added. | ||
* @see #isAddingLicenses() | ||
*/ | ||
public void setAddingLicensesForced(boolean addingLicensesForced) { | ||
this.addingLicensesForced = addingLicensesForced; | ||
} | ||
|
||
/** | ||
* Returns, whether RAT should add missing license headers. | ||
* @see #isAddingLicensesForced() | ||
* @see #getCopyrightMessage() | ||
*/ | ||
public boolean isAddingLicenses() { | ||
return addingLicenses; | ||
} | ||
|
||
/** | ||
* Returns, whether RAT should add missing license headers. | ||
* @see #setAddingLicensesForced(boolean) | ||
* @see #setCopyrightMessage(String) | ||
*/ | ||
public void setAddingLicenses(boolean addingLicenses) { | ||
this.addingLicenses = addingLicenses; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,3 +277,4 @@ public String toString() | |
} | ||
} | ||
} | ||
|
31 changes: 0 additions & 31 deletions
31
apache-rat-core/src/main/java/org/apache/rat/api/Reporter.java
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
apache-rat-core/src/main/java/org/apache/rat/report/AbstractReport.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package org.apache.rat.report; | ||
|
||
import org.apache.rat.api.Document; | ||
import org.apache.rat.api.RatException; | ||
|
||
|
||
/** | ||
* Abstract base class for deriving implementations of {@link RatReport}. | ||
*/ | ||
public abstract class AbstractReport implements RatReport { | ||
public void startReport() throws RatException { | ||
// Does nothing | ||
} | ||
|
||
public void report(Document document) throws RatException { | ||
// Does nothing | ||
} | ||
|
||
public void endReport() throws RatException { | ||
// Does nothing | ||
} | ||
} |
Oops, something went wrong.