Class Header
- java.lang.Object
-
- com.google.code.mojo.license.header.Header
-
public final class Header extends Object
TheHeader
class wraps the license template file, the one which have to be outputted inside the other files.- Author:
- Mathieu Carbou (mathieu.carbou@gmail.com)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
asOneLineString()
String
asString()
String
buildForDefinition(HeaderDefinition type, boolean unix)
String
eol(boolean unix)
int
getLineCount()
String[]
getLines()
URL
getLocation()
Returns the location of license template file.String
toString()
-
-
-
Constructor Detail
-
Header
public Header(URL location, Map<String,String> properties)
Constructs aHeader
object pointing to a license template file. In case of the template contains replaceable values (declared as ${valuename}), you can set the map of this values.- Parameters:
location
- The license template file location.properties
- The map of values to replace.- Throws:
IllegalArgumentException
- If the header file location is null or if an error occurred while reading the file content.
-
-
Method Detail
-
asString
public String asString()
-
asOneLineString
public String asOneLineString()
-
getLineCount
public int getLineCount()
-
getLocation
public URL getLocation()
Returns the location of license template file.- Returns:
- The URL location.
-
eol
public String eol(boolean unix)
-
buildForDefinition
public String buildForDefinition(HeaderDefinition type, boolean unix)
-
getLines
public String[] getLines()
-
-