CleanupComments Aspect
[CarExample Java-language Group]

This aspect is defined in file: ../../AspectXLib/car/Car/aspects/CleanupComments.ax ../../AspectXLib/java/ShoppingCart/aspects/CleanupComments.ax

Aspect Description

Adds a javadoc like comment to all undocumented method declarations. The generated comment has the following form:

/**
* @author: XWeaver
*
* @param type
* ...
* @return type
*/

Printing the @param tags is done by iterating (xsl:for-each) the predefined $paramNames variable. Return comments are only printed if the return type is not 'void'

Adds a Javadoc comment to all undocumented methods. The generated comments have the following form:

/**
* @author: XWeaver
*
* @param type
* ...
* @return type
*/

Printing the @param tags is done by iterating (xsl:for-each) the predefined $paramNames variable. Return comments are only printed if the return type is not 'void'

This aspect is an adapted aspect of the CleanupComments aspect used in the C++ Car example. The only thing which had to be changed was to replace the pointcut type src:function_decl to src:function because Java does not no such a thing as a function declaration.


Pointcuts

function_declUndocumentedMethods
  Points to all undocumented methods
unitUndocumentedFiles
  Points to all undocumented files
functionUndocumentedMethods
  Points to all undocumented methods
unitUndocumentedFiles
  Points to all undocumented files

Advices

addAddMethodComment
 Adds a block comment
addAddFileComment
 Adds a block comment
addAddMethodComment
 Adds a block comment
addAddFileComment
 Adds a block comment

Pointcut Documentation

function_decl UndocumentedMethods (source)
Points to all undocumented methods. The XPath constraint checks if the immediate preceding-sibling of a function_decl element is a src:comment element with the attribute type set to 'block'.
unit UndocumentedFiles (source)
Points to all undocumented files. The XPath constraint checks if the first child of unit element is a src:comment element with the attribute type set to 'block'.
function UndocumentedMethods (source)
Points to all undocumented methods. The XPath constraint checks if the immediate preceding-sibling of a function element is a src:comment element with the attribute type set to 'block'.
unit UndocumentedFiles (source)
Points to all undocumented files. The XPath constraint checks if the first child of unit element is a src:comment element with the attribute type set to 'block'.

Advice Documentation

add AddMethodComment (source)

Triplet: function_decl add comment

Adds a block comment. For more information see aspect documentation above

Refers to global pointcut: function_decl UndocumentedMethods

add AddFileComment (source)

Triplet: unit add comment

Adds a block comment. For more information see aspect documentation above

Refers to global pointcut: unit UndocumentedFiles

add AddMethodComment (source)

Triplet: function add comment

Adds a block comment. For more information see aspect documentation above

Refers to global pointcut: function UndocumentedMethods

add AddFileComment (source)

Triplet: unit add comment

Adds a block comment. For more information see aspect documentation above

Refers to global pointcut: unit UndocumentedFiles