abc.weaving.aspectinfo
Class DeclareMessage

java.lang.Object
  extended by abc.weaving.aspectinfo.Syntax
      extended by abc.weaving.aspectinfo.AbstractAdviceDecl
          extended by abc.weaving.aspectinfo.DeclareMessage
All Implemented Interfaces:
java.lang.Cloneable

public class DeclareMessage
extends AbstractAdviceDecl

A declare warning or declare error declaration.

Author:
Aske Simon Christensen, Ganesh Sittampalam

Nested Class Summary
static class DeclareMessage.MessageAdvice
           
 
Field Summary
static int ERROR
           
static int WARNING
           
 
Fields inherited from class abc.weaving.aspectinfo.AbstractAdviceDecl
pc, spec
 
Constructor Summary
DeclareMessage(int severity, Pointcut pc, java.lang.String message, Aspect aspct, Position pos)
           
 
Method Summary
 void debugInfo(java.lang.String prefix, java.lang.StringBuffer sb)
           
 void generateMessage(ShadowMatch sm)
           
 java.lang.String getMessage()
          Get the message to give if the pointcut matches anything.
 int getSeverity()
          Get the severity of the message.
 java.lang.String getSeverityName()
          Get the name of the severity of the message.
 WeavingEnv getWeavingEnv()
           
 Chain makeAdviceExecutionStmts(AdviceApplication aa, LocalGeneratorEx localgen, WeavingContext wc)
          Produce a chain containing the statements to execute this piece of advice.
 WeavingContext makeWeavingContext()
           
 Residue postResidue(ShadowMatch sm)
           
 void reportMessages(AdviceApplication adviceappl)
          Report any errors or warnings for this advice application.
 java.lang.String toString()
           
 
Methods inherited from class abc.weaving.aspectinfo.AbstractAdviceDecl
clone, errorInfo, getAdviceSpec, getApplCount, getAspect, getDefiningAspect, getFormals, getPointcut, getPrecedence, hasEnclosingJoinPoint, hasJoinPoint, hasJoinPointStaticPart, incrApplCount, makeCopyInAspect, preprocess, preResidue, resetForReweaving
 
Methods inherited from class abc.weaving.aspectinfo.Syntax
getPosition
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

WARNING

public static final int WARNING
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values
Constructor Detail

DeclareMessage

public DeclareMessage(int severity,
                      Pointcut pc,
                      java.lang.String message,
                      Aspect aspct,
                      Position pos)
Method Detail

getSeverity

public int getSeverity()
Get the severity of the message.

Returns:
either WARNING or ERROR.

getSeverityName

public java.lang.String getSeverityName()
Get the name of the severity of the message.

Returns:
either &qout;warning" or &qout;error".

getMessage

public java.lang.String getMessage()
Get the message to give if the pointcut matches anything.


toString

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

debugInfo

public void debugInfo(java.lang.String prefix,
                      java.lang.StringBuffer sb)
Specified by:
debugInfo in class AbstractAdviceDecl

getWeavingEnv

public WeavingEnv getWeavingEnv()
Specified by:
getWeavingEnv in class AbstractAdviceDecl

makeWeavingContext

public WeavingContext makeWeavingContext()
Specified by:
makeWeavingContext in class AbstractAdviceDecl

postResidue

public Residue postResidue(ShadowMatch sm)
Overrides:
postResidue in class AbstractAdviceDecl

generateMessage

public void generateMessage(ShadowMatch sm)

makeAdviceExecutionStmts

public Chain makeAdviceExecutionStmts(AdviceApplication aa,
                                      LocalGeneratorEx localgen,
                                      WeavingContext wc)
Description copied from class: AbstractAdviceDecl
Produce a chain containing the statements to execute this piece of advice. If execution reaches the beginning of the chain, then the advice definitely applies.

Specified by:
makeAdviceExecutionStmts in class AbstractAdviceDecl
Parameters:
aa - The advice application structure.
localgen - A local variable generator for the method body being woven into
wc - The weaving context

reportMessages

public void reportMessages(AdviceApplication adviceappl)
Report any errors or warnings for this advice application.

Overrides:
reportMessages in class AbstractAdviceDecl