|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.code.mojo.license.header.HeaderDefinition
public final class HeaderDefinition
The HeaderDefinition class defines what is needed to output a header text into the of the given file
type and what is needed to match the first line as well as the last line of a previous header of the given file
type.
Optionally you can define the lines you want to skip before outputting the header.
| Constructor Summary | |
|---|---|
HeaderDefinition(java.lang.String type)
Constructs a new HeaderDefinition with only initializing the header type. |
|
HeaderDefinition(java.lang.String type,
java.lang.String firstLine,
java.lang.String beforeEachLine,
java.lang.String endLine,
java.lang.String skipLinePattern,
java.lang.String firstLineDetectionPattern,
java.lang.String lastLineDetectionPattern,
boolean allowBlankLines,
boolean isMultiline)
Constructs a new HeaderDefinition object with every header definition properties. |
|
| Method Summary | |
|---|---|
boolean |
allowBlankLines()
|
boolean |
equals(java.lang.Object o)
|
java.lang.String |
getBeforeEachLine()
|
java.lang.String |
getEndLine()
|
java.lang.String |
getFirstLine()
|
protected java.util.regex.Pattern |
getSkipLinePattern()
|
java.lang.String |
getType()
|
int |
hashCode()
|
boolean |
isFirstHeaderLine(java.lang.String line)
Tells if the given content line is the first line of a possible header of this definition kind. |
boolean |
isLastHeaderLine(java.lang.String line)
Tells if the given content line is the last line of a possible header of this definition kind. |
boolean |
isMultiLine()
|
boolean |
isSkipLine(java.lang.String line)
Tells if the given content line must be skipped according to this header definition. |
void |
setPropertyFromString(java.lang.String property,
java.lang.String value)
Sets header definition properties using its property name and its string value. If you want to set a property to null you must not call this function. This function is mainly used while parsing properties from the XML configuration file. |
java.lang.String |
toString()
|
void |
validate()
Checks this header definition consistency, in other words if all the mandatory properties of the definition have been set. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public HeaderDefinition(java.lang.String type,
java.lang.String firstLine,
java.lang.String beforeEachLine,
java.lang.String endLine,
java.lang.String skipLinePattern,
java.lang.String firstLineDetectionPattern,
java.lang.String lastLineDetectionPattern,
boolean allowBlankLines,
boolean isMultiline)
HeaderDefinition object with every header definition properties.
type - The type name for this header definition.firstLine - The string to output before the content of the first line of this header.beforeEachLine - The string to output before the content of each line of this header (except
firstLine and endLine).endLine - The string to output before the content of the last line of this header.skipLinePattern - The pattern of lines to skip before being allowed to output this header or null
if it can be outputted from the line of the file.firstLineDetectionPattern - The pattern to detect the first line of a previous header.lastLineDetectionPattern - The pattern to detect the last line of a previous header.
java.lang.IllegalArgumentException - If the type name is null.public HeaderDefinition(java.lang.String type)
HeaderDefinition with only initializing the header type. You must then set all the
other definitions properties manually in order to have a coherent object.
type - The type name for this header definition.
java.lang.IllegalArgumentException - If the type name is null.check(String, String),
setPropertyFromString(String, String)| Method Detail |
|---|
public java.lang.String getFirstLine()
public java.lang.String getBeforeEachLine()
public java.lang.String getEndLine()
public java.lang.String getType()
public boolean allowBlankLines()
public boolean isSkipLine(java.lang.String line)
line - The line to test.
public boolean isFirstHeaderLine(java.lang.String line)
line - The line to test.
public boolean isLastHeaderLine(java.lang.String line)
line - The line to test.
protected java.util.regex.Pattern getSkipLinePattern()
public void setPropertyFromString(java.lang.String property,
java.lang.String value)
property - The property name.value - The property value.
java.lang.IllegalArgumentException - If the property value is null.public void validate()
java.lang.IllegalStateException - If a mandatory property has not been set.public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isMultiLine()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||