org.codehaus.mojo.license.header
Class FileHeaderFilter

java.lang.Object
  extended by org.nuiton.processor.filters.DefaultFilter
      extended by org.codehaus.mojo.license.header.FileHeaderFilter
All Implemented Interfaces:
org.nuiton.processor.filters.Filter
Direct Known Subclasses:
UpdateFileHeaderFilter

public abstract class FileHeaderFilter
extends org.nuiton.processor.filters.DefaultFilter

File Header filter.

Since:
1.0
Author:
tchemit

Nested Class Summary
 
Nested classes/interfaces inherited from class org.nuiton.processor.filters.DefaultFilter
org.nuiton.processor.filters.DefaultFilter.State
 
Field Summary
protected  boolean detectHeader
          flag set to true as soon as start process tag was detected.
protected  FileHeader fileHeader
          incoming default file header model
protected  String fullHeaderContent
          cached full header content (with process tag + comment box)
protected  String headerContent
          cached header content
protected  org.apache.maven.plugin.logging.Log log
          maven logger
protected  boolean modified
          flag set to true when a header was detected and was modified.
protected  String processTagHeaderContent
          cached full header content (with process tag + comment box)
protected  boolean touched
          flag set to true when a header was detected (says detects both start and end process tags).
protected  FileHeaderTransformer transformer
          header transformer
 
Fields inherited from class org.nuiton.processor.filters.DefaultFilter
cachedContent, NOT_FOUND, reader, state
 
Fields inherited from interface org.nuiton.processor.filters.Filter
EMPTY_STRING
 
Constructor Summary
FileHeaderFilter()
           
 
Method Summary
protected  void changeState(org.nuiton.processor.filters.DefaultFilter.State newState)
           
 FileHeader getFileHeader()
           
protected  String getFooter()
           
 String getFullHeaderContent()
           
protected  String getHeader()
           
 String getHeaderContent()
           
 org.apache.maven.plugin.logging.Log getLog()
           
protected abstract  FileHeader getNewHeader(FileHeader oldHeader)
          Obtains the new header to use according to the old one.
 String getProcessTagHeaderContent()
           
 FileHeaderTransformer getTransformer()
           
 boolean isDetectHeader()
           
 boolean isModified()
           
 boolean isTouched()
           
protected  String performInFilter(String ch)
           
protected  String performOutFilter(String ch)
           
 void reset()
           
 void resetContent()
           
 void setFileHeader(FileHeader fileHeader)
           
 void setLog(org.apache.maven.plugin.logging.Log log)
           
 void setTransformer(FileHeaderTransformer transformer)
           
 
Methods inherited from class org.nuiton.processor.filters.DefaultFilter
flush, getLineNumber, getMatchIndexFor, getMatchLengthFor, hasCachedData, parse, performHeaderFooterFilter, setReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

touched

protected boolean touched
flag set to true when a header was detected (says detects both start and end process tags).


modified

protected boolean modified
flag set to true when a header was detected and was modified.


detectHeader

protected boolean detectHeader
flag set to true as soon as start process tag was detected.


fileHeader

protected FileHeader fileHeader
incoming default file header model


transformer

protected FileHeaderTransformer transformer
header transformer


headerContent

protected String headerContent
cached header content


processTagHeaderContent

protected String processTagHeaderContent
cached full header content (with process tag + comment box)


fullHeaderContent

protected String fullHeaderContent
cached full header content (with process tag + comment box)


log

protected org.apache.maven.plugin.logging.Log log
maven logger

Constructor Detail

FileHeaderFilter

public FileHeaderFilter()
Method Detail

getNewHeader

protected abstract FileHeader getNewHeader(FileHeader oldHeader)
Obtains the new header to use according to the old one.

Note: If the new header should not be updated, then the result is null.

Parameters:
oldHeader - the old header found in file.
Returns:
null if header is still the same, otherwise the new header to apply
Since:
1.0

getLog

public org.apache.maven.plugin.logging.Log getLog()

setLog

public void setLog(org.apache.maven.plugin.logging.Log log)

performInFilter

protected String performInFilter(String ch)
Specified by:
performInFilter in class org.nuiton.processor.filters.DefaultFilter

performOutFilter

protected String performOutFilter(String ch)
Specified by:
performOutFilter in class org.nuiton.processor.filters.DefaultFilter

getHeader

protected String getHeader()
Specified by:
getHeader in class org.nuiton.processor.filters.DefaultFilter

getFooter

protected String getFooter()
Specified by:
getFooter in class org.nuiton.processor.filters.DefaultFilter

changeState

protected void changeState(org.nuiton.processor.filters.DefaultFilter.State newState)
Overrides:
changeState in class org.nuiton.processor.filters.DefaultFilter

getHeaderContent

public String getHeaderContent()

getProcessTagHeaderContent

public String getProcessTagHeaderContent()

getFullHeaderContent

public String getFullHeaderContent()

isTouched

public boolean isTouched()

isModified

public boolean isModified()

isDetectHeader

public boolean isDetectHeader()

getFileHeader

public FileHeader getFileHeader()

getTransformer

public FileHeaderTransformer getTransformer()

setFileHeader

public void setFileHeader(FileHeader fileHeader)

setTransformer

public void setTransformer(FileHeaderTransformer transformer)

reset

public void reset()

resetContent

public void resetContent()


Copyright © 2010-2012 The Kuali Foundation. All Rights Reserved.