com.google.code.mojo.license.header
Class Header

java.lang.Object
  extended by com.google.code.mojo.license.header.Header

public final class Header
extends java.lang.Object

The Header class wraps the license template file, the one which have to be outputted inside the other files.

Author:
Mathieu Carbou (mathieu.carbou@gmail.com)

Constructor Summary
Header(java.net.URL location, java.util.Map<java.lang.String,java.lang.String> properties)
          Constructs a Header object pointing to a license template file.
 
Method Summary
 java.lang.String asOneLineString()
           
 java.lang.String asString()
           
 java.lang.String buildForDefinition(HeaderDefinition type, boolean unix)
           
 java.lang.String eol(boolean unix)
           
 int getLineCount()
           
 java.lang.String[] getLines()
           
 java.net.URL getLocation()
          Returns the location of license template file.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Header

public Header(java.net.URL location,
              java.util.Map<java.lang.String,java.lang.String> properties)
Constructs a Header 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:
java.lang.IllegalArgumentException - If the header file location is null or if an error occurred while reading the file content.
Method Detail

asString

public java.lang.String asString()

asOneLineString

public java.lang.String asOneLineString()

getLineCount

public int getLineCount()

getLocation

public java.net.URL getLocation()
Returns the location of license template file.

Returns:
The URL location.

eol

public java.lang.String eol(boolean unix)

buildForDefinition

public java.lang.String buildForDefinition(HeaderDefinition type,
                                           boolean unix)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getLines

public java.lang.String[] getLines()


Copyright © 2008-2011 Mathieu Carbou. All Rights Reserved.