* A style that is not multi-line is usually repeating in each line the characters before and after each line to delimit a one-line comment.
*/
- @Parameter
- public boolean multiline = true;
+ @Parameter(alias = "multiline")
+ public boolean multiLine = true;
/**
* Only for multi-line comments: specify if blank lines are allowed.
@@ -101,6 +101,6 @@ public class HeaderStyle {
public String lastLineDetectionPattern;
public HeaderDefinition toHeaderDefinition() {
- return new HeaderDefinition(name, firstLine, beforeEachLine, endLine, afterEachLine, skipLinePattern, firstLineDetectionPattern, lastLineDetectionPattern, allowBlankLines, multiline, padLines);
+ return new HeaderDefinition(name, firstLine, beforeEachLine, endLine, afterEachLine, skipLinePattern, firstLineDetectionPattern, lastLineDetectionPattern, allowBlankLines, multiLine, padLines);
}
}
diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderDefinition.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderDefinition.java
index 8a8cb5a6e..4be490d1f 100755
--- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderDefinition.java
+++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderDefinition.java
@@ -35,7 +35,7 @@ public final class HeaderDefinition {
private Pattern skipLinePattern;
private Pattern firstLineDetectionPattern;
private Pattern lastLineDetectionPattern;
- private Boolean isMultiline;
+ private Boolean multiLine;
private boolean padLines = false;
@@ -60,7 +60,7 @@ public HeaderDefinition(String type,
String endLine, String afterEachLine,
String skipLinePattern,
String firstLineDetectionPattern, String lastLineDetectionPattern,
- boolean allowBlankLines, boolean isMultiline, boolean padLines) {
+ boolean allowBlankLines, boolean multiLine, boolean padLines) {
this(type);
this.firstLine = firstLine;
this.beforeEachLine = beforeEachLine;
@@ -70,11 +70,11 @@ public HeaderDefinition(String type,
this.firstLineDetectionPattern = compile(firstLineDetectionPattern);
this.lastLineDetectionPattern = compile(lastLineDetectionPattern);
this.allowBlankLines = allowBlankLines;
- this.isMultiline = isMultiline;
+ this.multiLine = multiLine;
this.padLines = padLines;
if (!"unknown".equals(type)) validate();
- if (allowBlankLines && !isMultiline) {
- throw new IllegalArgumentException("Header style " + type + " is configured to allow blank lines, so it should be set as a multiline header style");
+ if (allowBlankLines && !multiLine) {
+ throw new IllegalArgumentException("Header style " + type + " is configured to allow blank lines, so it should be set as a multi-line header style");
}
}
@@ -178,8 +178,8 @@ public void setPropertyFromString(String property, String value) {
firstLine = value;
else if ("allowBlankLines".equalsIgnoreCase(property))
allowBlankLines = Boolean.valueOf(value);
- else if ("isMultiline".equalsIgnoreCase(property))
- isMultiline = Boolean.valueOf(value);
+ else if ("multiLine".equalsIgnoreCase(property) || "isMultiline".equalsIgnoreCase(property))
+ multiLine = Boolean.valueOf(value);
else if ("beforeEachLine".equalsIgnoreCase(property))
beforeEachLine = value;
else if ("endLine".equalsIgnoreCase(property))
@@ -210,7 +210,7 @@ public void validate() {
check("afterEachLine", this.afterEachLine);
check("firstLineDetectionPattern", this.firstLineDetectionPattern);
check("lastLineDetectionPattern", this.lastLineDetectionPattern);
- check("isMultiline", this.isMultiline);
+ check("multiLine", this.multiLine);
check("allowBlankLines", this.allowBlankLines);
// skip line can be null
}
@@ -256,6 +256,6 @@ public String toString() {
}
public boolean isMultiLine() {
- return isMultiline;
+ return multiLine;
}
}
diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderType.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderType.java
index afc6a5d8a..3c5a9795b 100755
--- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderType.java
+++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderType.java
@@ -30,7 +30,7 @@ public enum HeaderType {
////////// COMMENT TYPES //////////
////////// COMMENT TYPES //////////
- // firstLine beforeEachLine endLine afterEachLine skipLinePattern firstLineDetectionPattern lastLineDetectionPattern allowBlankLines isMultiline padLines
+ // firstLine beforeEachLine endLine afterEachLine skipLinePattern firstLineDetectionPattern lastLineDetectionPattern allowBlankLines multiLine padLines
//generic
ASCIIDOC_STYLE("////", " // ", "////EOL", "", null, "^////$", "^////$", false, true, false),
MVEL_STYLE("@comment{", " ", "}", "", null, "@comment\\{$", "\\}$", true, true, false),
@@ -85,8 +85,8 @@ public enum HeaderType {
private HeaderType(String firstLine, String beforeEachLine,
String endLine, String afterEachLine,
String skipLinePattern, String firstLineDetectionPattern, String lastLineDetectionPattern,
- boolean allowBlankLines, boolean isMultiline, boolean padLines) {
- definition = new HeaderDefinition(this.name().toLowerCase(), firstLine, beforeEachLine, endLine, afterEachLine, skipLinePattern, firstLineDetectionPattern, lastLineDetectionPattern, allowBlankLines, isMultiline, padLines);
+ boolean allowBlankLines, boolean multiLine, boolean padLines) {
+ definition = new HeaderDefinition(this.name().toLowerCase(), firstLine, beforeEachLine, endLine, afterEachLine, skipLinePattern, firstLineDetectionPattern, lastLineDetectionPattern, allowBlankLines, multiLine, padLines);
}
/**
diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java
index 240cd1f0c..9e6be9197 100755
--- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java
+++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java
@@ -73,7 +73,7 @@ public void test_inline() throws Exception {
style.firstLineDetectionPattern = "\\:\\(";
style.lastLineDetectionPattern = "\\:\\(";
style.allowBlankLines = false;
- style.multiline = false;
+ style.multiLine = false;
check.defaultInlineHeaderStyles = new HeaderStyle[]{style};
check.mapping = Collections.singletonMap("txt", "smiley");
diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java
index f9079d032..32b294a4c 100755
--- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java
+++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java
@@ -40,7 +40,7 @@ public void test_load_definitions() throws Exception {
.addTag("firstLineDetectionPattern").addText("\\(\\:")
.addTag("lastLineDetectionPattern").addText("\\:\\)")
.addTag("allowBlankLines").addText("false")
- .addTag("isMultiline").addText("false");
+ .addTag("multiLine").addText("false");
System.out.println(def.toString());
@@ -69,7 +69,7 @@ public void test_load_definitions2() throws Exception {
.addTag("firstLineDetectionPattern").addText("\\:\\(")
.addTag("lastLineDetectionPattern").addText("\\:\\(")
.addTag("allowBlankLines").addText("false")
- .addTag("isMultiline").addText("false");
+ .addTag("multiLine").addText("false");
System.out.println(def.toString());
@@ -90,7 +90,7 @@ public void test_advanced_definitions() throws Exception {
.addTag("firstLineDetectionPattern").addText("#region.*^EOL/\\*\\*.*$")
.addTag("lastLineDetectionPattern").addText("\\*/EOL#endregion")
.addTag("allowBlankLines").addText("false")
- .addTag("isMultiline").addText("false");
+ .addTag("multiLine").addText("false");
AdditionalHeaderDefinition loader = new AdditionalHeaderDefinition(def);
diff --git a/license-maven-plugin/src/test/resources/check/def/additionalHeaderDefinitions.xml b/license-maven-plugin/src/test/resources/check/def/additionalHeaderDefinitions.xml
index 941ad965b..3fd626c20 100755
--- a/license-maven-plugin/src/test/resources/check/def/additionalHeaderDefinitions.xml
+++ b/license-maven-plugin/src/test/resources/check/def/additionalHeaderDefinitions.xml
@@ -8,7 +8,7 @@