1 12 package org.aspectj.internal.lang.reflect; 13 14 import org.aspectj.lang.reflect.AjType; 15 import org.aspectj.lang.reflect.DeclareErrorOrWarning; 16 import org.aspectj.lang.reflect.PointcutExpression; 17 18 22 public class DeclareErrorOrWarningImpl implements DeclareErrorOrWarning { 23 24 private PointcutExpression pc; 25 private String msg; 26 private boolean isError; 27 private AjType declaringType; 28 29 public DeclareErrorOrWarningImpl(String pointcut, String message, boolean isError, AjType decType) { 30 this.pc = new PointcutExpressionImpl(pointcut); 31 this.msg = message; 32 this.isError = isError; 33 this.declaringType = decType; 34 } 35 36 public AjType getDeclaringType() { return this.declaringType; } 37 38 41 public PointcutExpression getPointcutExpression() { 42 return pc; 43 } 44 45 48 public String getMessage() { 49 return msg; 50 } 51 52 55 public boolean isError() { 56 return isError; 57 } 58 59 public String toString() { 60 StringBuffer sb = new StringBuffer (); 61 sb.append("declare "); 62 sb.append(isError() ? "error : " : "warning : "); 63 sb.append(getPointcutExpression().asString()); 64 sb.append(" : "); 65 sb.append("\""); 66 sb.append(getMessage()); 67 sb.append("\""); 68 return sb.toString(); 69 } 70 71 } 72 | Popular Tags |