org.codehaus.mojo.scmchangelog.changelog.log.grammar
Class AbstractRegexpScmGrammar

java.lang.Object
  extended by org.codehaus.mojo.scmchangelog.changelog.log.grammar.AbstractScmGrammar
      extended by org.codehaus.mojo.scmchangelog.changelog.log.grammar.AbstractRegexpScmGrammar
All Implemented Interfaces:
ScmGrammar
Direct Known Subclasses:
ManuScmGrammar, RemyScmGrammar

public abstract class AbstractRegexpScmGrammar
extends AbstractScmGrammar

Abstract grammar to be used as an helper class.

Version:
$Id: AbstractScmGrammar.java 9280 2009-03-26 19:21:50Z ehsavoie $
Author:
ehsavoie

Field Summary
 
Fields inherited from interface org.codehaus.mojo.scmchangelog.changelog.log.ScmGrammar
NEW_LINE
 
Constructor Summary
AbstractRegexpScmGrammar()
           
 
Method Summary
protected  String computeIssues(OperationTypeEnum type, String expression, List issues)
          Extract all issues of same type from the SVN comment.
 Message extractMessage(String content)
          Extracts the message (list of issues)from the comment.
abstract  Matcher getAddCleaner(String expression)
          Getter for the regexp matcher to clean the comments of the ADD issues.
abstract  Matcher getAddMatcher(String expression)
          Getter for the regexp matcher to find the comments of the ADD issues.
protected  Matcher getCleaner(OperationTypeEnum type, String expression)
          Return the regexp used for removing grammar elements from the comments.
protected  Matcher getFinder(OperationTypeEnum type, String expression)
          Return the regexp used for finding grammar elements from the comments.
abstract  Matcher getFixCleaner(String expression)
          Getter for the regexp matcher to clean the comments of the FIX issues.
abstract  Matcher getFixMatcher(String expression)
          Getter for the regexp matcher to find the comments of the FIX issues.
 String getIssueSeparator()
          Returns the String to be inserted between each issue comment.
abstract  Matcher getRemoveCleaner(String expression)
          Getter for the regexp matcher to clean the comments of the REMOVE issues.
abstract  Matcher getRemoveMatcher(String expression)
          Getter for the regexp matcher to find the comments of the REMOVE issues.
abstract  Matcher getUpdateCleaner(String expression)
          Getter for the regexp matcher to clean the comments of the UPDATE issues.
abstract  Matcher getUpdateMatcher(String expression)
          Getter for the regexp matcher to find the comments of the UPDATE issues.
 boolean hasMessage(String content)
          Indicates if the content respects the grammar used to extract issues.
 
Methods inherited from class org.codehaus.mojo.scmchangelog.changelog.log.grammar.AbstractScmGrammar
removeComments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRegexpScmGrammar

public AbstractRegexpScmGrammar()
Method Detail

extractMessage

public Message extractMessage(String content)
Extracts the message (list of issues)from the comment.

Parameters:
content - the comment of the log entry.
Returns:
the message
See Also:
Message

hasMessage

public boolean hasMessage(String content)
Indicates if the content respects the grammar used to extract issues.

Parameters:
content - the content to be checked
Returns:
true if the content uses the grammar - false otherwise.

computeIssues

protected String computeIssues(OperationTypeEnum type,
                               String expression,
                               List issues)
Extract all issues of same type from the SVN comment.

Parameters:
type - : type of issue to be extracted.
expression - : svn comment.
issues - : the list of issues already found.
Returns:
the comment after extraction.

getCleaner

protected Matcher getCleaner(OperationTypeEnum type,
                             String expression)
Return the regexp used for removing grammar elements from the comments.

Parameters:
type - : type of issue to be extracted.
expression - : svn comment.
Returns:
the regexp matcher for 'cleaning' the comments.

getFinder

protected Matcher getFinder(OperationTypeEnum type,
                            String expression)
Return the regexp used for finding grammar elements from the comments.

Parameters:
type - : type of issue to be extracted.
expression - : svn comment.
Returns:
the regexp matcher for finding the comments.

getIssueSeparator

public String getIssueSeparator()
Returns the String to be inserted between each issue comment. It may be replaced when generating the report.

Returns:
the String to be inserted between each issue comment.

getFixCleaner

public abstract Matcher getFixCleaner(String expression)
Getter for the regexp matcher to clean the comments of the FIX issues.

Parameters:
expression - the regexp for cleaning the comments of the FIX issues.
Returns:
a Matcher to clean the comments of FIX issues.

getUpdateCleaner

public abstract Matcher getUpdateCleaner(String expression)
Getter for the regexp matcher to clean the comments of the UPDATE issues.

Parameters:
expression - the regexp for cleaning the comments of the UPDATE issues.
Returns:
a regexp matcher to clean the comments of UPDATE issues.

getAddCleaner

public abstract Matcher getAddCleaner(String expression)
Getter for the regexp matcher to clean the comments of the ADD issues.

Parameters:
expression - the regexp for cleaning the comments of the ADD issues.
Returns:
a regexp matcher to clean the comments of ADD issues.

getRemoveCleaner

public abstract Matcher getRemoveCleaner(String expression)
Getter for the regexp matcher to clean the comments of the REMOVE issues.

Parameters:
expression - the regexp for cleaning the comments of the REMOVE issues.
Returns:
a regexp matcher to clean the comments of REMOVE issues.

getFixMatcher

public abstract Matcher getFixMatcher(String expression)
Getter for the regexp matcher to find the comments of the FIX issues.

Parameters:
expression - the regexp for finding the comments of the FIX issues.
Returns:
a regexp matcher to find the comments of FIX issues.

getAddMatcher

public abstract Matcher getAddMatcher(String expression)
Getter for the regexp matcher to find the comments of the ADD issues.

Parameters:
expression - the regexp for finding the comments of the ADD issues.
Returns:
a regexp matcher to find the comments of ADD issues.

getRemoveMatcher

public abstract Matcher getRemoveMatcher(String expression)
Getter for the regexp matcher to find the comments of the REMOVE issues.

Parameters:
expression - the regexp for finding the comments of the REMOVE issues.
Returns:
a regexp matcher to find the comments of REMOVE issues.

getUpdateMatcher

public abstract Matcher getUpdateMatcher(String expression)
Getter for the regexp matcher to find the comments of the UPDATE issues.

Parameters:
expression - the regexp for finding the comments of the UPDATE issues.
Returns:
a regexp matcher to find the comments of UPDATE issues.


Copyright © 2008-2009 Codehaus. All Rights Reserved.