org.acmsl.contractchecker
Class ContractCheckerAspectTemplate

java.lang.Object
  |
  +--org.acmsl.contractchecker.ContractCheckerAspectTemplate

public abstract class ContractCheckerAspectTemplate
extends java.lang.Object

Template to generate AspectJ's aspect to ensure pre- and post-conditions are satisfied.

Version:
$Revision: 1.8 $
Author:
Jose San Leandro

Field Summary
static java.lang.String DEFAULT_ASPECT_DEFINITION
          The aspect definition.
static java.lang.String DEFAULT_ASPECT_END
          The default aspect end.
static java.lang.String DEFAULT_ASPECT_JAVADOC
          The default aspect Javadoc.
static java.lang.String DEFAULT_ASPECT_START
          The aspect start.
static java.lang.String DEFAULT_EXCEPTION_DECLARATION
          The default exception declarations.
static java.lang.String DEFAULT_HEADER
          The default header.
static java.lang.String DEFAULT_PACKAGE_DECLARATION
          The default package declaration.
static java.lang.String DEFAULT_PRECONDITION_ADVICE
          The default precondition advice.
static java.lang.String DEFAULT_PRECONDITION_CHECK
          The default precondition check.
static java.lang.String DEFAULT_PRECONDITION_POINTCUT
          The default precondition pointcut Javadoc.
static java.lang.String DEFAULT_PROJECT_IMPORTS
          The project imports.
static java.lang.String DEFAULT_PROJECT_IMPORTS_JAVADOC
          The default project imports.
 
Constructor Summary
ContractCheckerAspectTemplate(java.lang.String packageName, java.lang.String defaultException)
          Builds a ContractCheckerAspectTemplate using given information.
ContractCheckerAspectTemplate(java.lang.String header, java.lang.String packageDeclaration, java.lang.String packageName, java.lang.String defaultException, java.lang.String projectImportsJavadoc, java.lang.String projectImports, java.lang.String aspectJavadoc, java.lang.String aspectDefinition, java.lang.String aspectStart, java.lang.String preconditionPointcut, java.lang.String exceptionDeclaration, java.lang.String preconditionAdvice, java.lang.String preconditionCheck, java.lang.String aspectEnd)
          Builds a ContractCheckerAspect using given information.
 
Method Summary
 void addClass(com.thoughtworks.qdox.model.JavaClass javaClass)
          Adds a new class.
 java.lang.String getAspectDefinition()
          Retrieves the aspect definition.
 java.lang.String getAspectEnd()
          Retrieves the aspect end.
 java.lang.String getAspectJavadoc()
          Retrieves the aspect javadoc.
 java.lang.String getAspectStart()
          Retrieves the aspect start.
protected  java.util.List getClasses()
          Retrieves the classes.
 java.lang.String getExceptionDeclaration()
          Retrieves the exception declaration.
 java.lang.String getHeader()
          Retrieves the header.
 java.lang.String getPackageDeclaration()
          Retrieves the package declaration.
 java.lang.String getPackageName()
          Retrieves the package name.
 java.lang.String getPreconditionAdvice()
          Retrieves the precondition advice.
 java.lang.String getPreconditionCheck()
          Retrieves the precondition check.
 java.lang.String getPreconditionPointcut()
          Retrieves the precondition pointcut.
 java.lang.String getProjectImports()
          Retrieves the project imports.
 java.lang.String getProjectImportsJavadoc()
          Retrieves the project imports' Javadoc.
 java.lang.String getViolationException()
          Retrieves the default exception.
protected  void setAspectDefinition(java.lang.String aspectDefinition)
          Specifies the aspect definition.
protected  void setAspectEnd(java.lang.String aspectEnd)
          Specifies the aspect end.
protected  void setAspectJavadoc(java.lang.String javadoc)
          Specifies the Javadoc for the aspect.
protected  void setAspectStart(java.lang.String aspectStart)
          Specifies the aspect start.
protected  void setClasses(java.util.List classes)
          Specifies the classes.
protected  void setExceptionDeclaration(java.lang.String exceptionDeclaration)
          Specifies the exception declaration.
protected  void setHeader(java.lang.String header)
          Specifies the header.
protected  void setPackageDeclaration(java.lang.String packageDeclaration)
          Specifies the package declaration.
protected  void setPackageName(java.lang.String packageName)
          Specifies the package name.
protected  void setPreconditionAdvice(java.lang.String preconditionAdvice)
          Specifies the precondition advice.
protected  void setPreconditionCheck(java.lang.String preconditionCheck)
          Specifies the precondition check.
protected  void setPreconditionPointcut(java.lang.String preconditionPointcut)
          Specifies the precondition pointcut.
protected  void setProjectImports(java.lang.String projectImports)
          Specifies the project imports.
protected  void setProjectImportsJavadoc(java.lang.String javadocImports)
          Specifies the project imports' Javadoc.
protected  void setViolationException(java.lang.String defaultException)
          Specifies the default exception.
 java.lang.String toString()
          Retrieves the source code of the generated table repository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_HEADER

public static final java.lang.String DEFAULT_HEADER
The default header.

See Also:
Constant Field Values

DEFAULT_PACKAGE_DECLARATION

public static final java.lang.String DEFAULT_PACKAGE_DECLARATION
The default package declaration.

See Also:
Constant Field Values

DEFAULT_PROJECT_IMPORTS_JAVADOC

public static final java.lang.String DEFAULT_PROJECT_IMPORTS_JAVADOC
The default project imports.

See Also:
Constant Field Values

DEFAULT_PROJECT_IMPORTS

public static final java.lang.String DEFAULT_PROJECT_IMPORTS
The project imports.

See Also:
Constant Field Values

DEFAULT_ASPECT_JAVADOC

public static final java.lang.String DEFAULT_ASPECT_JAVADOC
The default aspect Javadoc.

See Also:
Constant Field Values

DEFAULT_ASPECT_DEFINITION

public static final java.lang.String DEFAULT_ASPECT_DEFINITION
The aspect definition.

See Also:
Constant Field Values

DEFAULT_ASPECT_START

public static final java.lang.String DEFAULT_ASPECT_START
The aspect start.

See Also:
Constant Field Values

DEFAULT_PRECONDITION_POINTCUT

public static final java.lang.String DEFAULT_PRECONDITION_POINTCUT
The default precondition pointcut Javadoc.

See Also:
Constant Field Values

DEFAULT_EXCEPTION_DECLARATION

public static final java.lang.String DEFAULT_EXCEPTION_DECLARATION
The default exception declarations.

See Also:
Constant Field Values

DEFAULT_PRECONDITION_ADVICE

public static final java.lang.String DEFAULT_PRECONDITION_ADVICE
The default precondition advice.

See Also:
Constant Field Values

DEFAULT_PRECONDITION_CHECK

public static final java.lang.String DEFAULT_PRECONDITION_CHECK
The default precondition check.

See Also:
Constant Field Values

DEFAULT_ASPECT_END

public static final java.lang.String DEFAULT_ASPECT_END
The default aspect end.

See Also:
Constant Field Values
Constructor Detail

ContractCheckerAspectTemplate

public ContractCheckerAspectTemplate(java.lang.String header,
                                     java.lang.String packageDeclaration,
                                     java.lang.String packageName,
                                     java.lang.String defaultException,
                                     java.lang.String projectImportsJavadoc,
                                     java.lang.String projectImports,
                                     java.lang.String aspectJavadoc,
                                     java.lang.String aspectDefinition,
                                     java.lang.String aspectStart,
                                     java.lang.String preconditionPointcut,
                                     java.lang.String exceptionDeclaration,
                                     java.lang.String preconditionAdvice,
                                     java.lang.String preconditionCheck,
                                     java.lang.String aspectEnd)
Builds a ContractCheckerAspect using given information.

Parameters:
header - the header.
packageDeclaration - the package declaration.
packageName - the package name.
defaultException - the default exception.
projectImportsJavadoc - the project imports javadoc.
projectImports - the project imports.
aspectJavadoc - the aspect Javadoc.
aspectDefinition - the aspect definition.
aspectStart - the aspect start.
preconditionPointcut - the precondition pointcut.
exceptionDeclaration - the exception declaration.
preconditionAdvice - the precondition advice.
preconditionCheck - the precondition check.
aspectEnd - the aspect end.

ContractCheckerAspectTemplate

public ContractCheckerAspectTemplate(java.lang.String packageName,
                                     java.lang.String defaultException)
Builds a ContractCheckerAspectTemplate using given information.

Parameters:
packageName - the package name.
defaultException - the default exception.
Method Detail

setHeader

protected void setHeader(java.lang.String header)
Specifies the header.

Parameters:
header - the new header.

getHeader

public java.lang.String getHeader()
Retrieves the header.

Returns:
such information.

setPackageDeclaration

protected void setPackageDeclaration(java.lang.String packageDeclaration)
Specifies the package declaration.

Parameters:
packageDeclaration - the new package declaration.

getPackageDeclaration

public java.lang.String getPackageDeclaration()
Retrieves the package declaration.

Returns:
such information.

setPackageName

protected void setPackageName(java.lang.String packageName)
Specifies the package name.

Parameters:
packageName - the new package name.

getPackageName

public java.lang.String getPackageName()
Retrieves the package name.

Returns:
such information.

setViolationException

protected void setViolationException(java.lang.String defaultException)
Specifies the default exception.

Parameters:
defaultException - the new default exception.

getViolationException

public java.lang.String getViolationException()
Retrieves the default exception.

Returns:
such information.

setProjectImportsJavadoc

protected void setProjectImportsJavadoc(java.lang.String javadocImports)
Specifies the project imports' Javadoc.


getProjectImportsJavadoc

public java.lang.String getProjectImportsJavadoc()
Retrieves the project imports' Javadoc.

Returns:
such information.

setProjectImports

protected void setProjectImports(java.lang.String projectImports)
Specifies the project imports.

Parameters:
projectImports - the new project imports.

getProjectImports

public java.lang.String getProjectImports()
Retrieves the project imports.

Returns:
such information.

setAspectJavadoc

protected void setAspectJavadoc(java.lang.String javadoc)
Specifies the Javadoc for the aspect.

Parameters:
javadoc - the new javadoc.

getAspectJavadoc

public java.lang.String getAspectJavadoc()
Retrieves the aspect javadoc.

Returns:
such information.

setAspectDefinition

protected void setAspectDefinition(java.lang.String aspectDefinition)
Specifies the aspect definition.

Parameters:
aspectDefinition - the new aspect definition.

getAspectDefinition

public java.lang.String getAspectDefinition()
Retrieves the aspect definition.

Returns:
such information.

setAspectStart

protected void setAspectStart(java.lang.String aspectStart)
Specifies the aspect start.

Parameters:
aspectStart - the new aspect start.

getAspectStart

public java.lang.String getAspectStart()
Retrieves the aspect start.

Returns:
such information.

setPreconditionPointcut

protected void setPreconditionPointcut(java.lang.String preconditionPointcut)
Specifies the precondition pointcut.

Parameters:
preconditionPointcut - the new pointcut.

getPreconditionPointcut

public java.lang.String getPreconditionPointcut()
Retrieves the precondition pointcut.

Returns:
such information.

setExceptionDeclaration

protected void setExceptionDeclaration(java.lang.String exceptionDeclaration)
Specifies the exception declaration.

Parameters:
exceptionDeclaration - the new exception declaration.

getExceptionDeclaration

public java.lang.String getExceptionDeclaration()
Retrieves the exception declaration.

Returns:
such information.

setPreconditionAdvice

protected void setPreconditionAdvice(java.lang.String preconditionAdvice)
Specifies the precondition advice.

Parameters:
preconditionAdvice - the new advice.

getPreconditionAdvice

public java.lang.String getPreconditionAdvice()
Retrieves the precondition advice.

Returns:
such information.

setPreconditionCheck

protected void setPreconditionCheck(java.lang.String preconditionCheck)
Specifies the precondition check.

Parameters:
preconditionCheck - the new check.

getPreconditionCheck

public java.lang.String getPreconditionCheck()
Retrieves the precondition check.

Returns:
such information.

setAspectEnd

protected void setAspectEnd(java.lang.String aspectEnd)
Specifies the aspect end.

Parameters:
aspectEnd - the new aspect end.

getAspectEnd

public java.lang.String getAspectEnd()
Retrieves the aspect end.

Returns:
such information.

setClasses

protected void setClasses(java.util.List classes)
Specifies the classes.

Parameters:
classes - the class list.

getClasses

protected java.util.List getClasses()
Retrieves the classes.

Returns:
such collection.

addClass

public void addClass(com.thoughtworks.qdox.model.JavaClass javaClass)
Adds a new class.


toString

public java.lang.String toString()
Retrieves the source code of the generated table repository.

Overrides:
toString in class java.lang.Object
Returns:
such source code.


Copyright © 2003-2004 ACM S.L.. All Rights Reserved.