1 22 package org.jboss.aop.pointcut; 23 24 import javassist.CtField; 25 import javassist.NotFoundException; 26 import org.jboss.aop.Advisor; 27 import org.jboss.aop.pointcut.ast.ASTSet; 28 import org.jboss.aop.pointcut.ast.ASTStart; 29 30 import java.lang.reflect.Field ; 31 32 38 public class FieldSetMatcher extends FieldMatcher 39 { 40 private CtField ctField; 41 private Field field; 42 43 public FieldSetMatcher(Advisor advisor, CtField field, ASTStart start) throws NotFoundException 44 { 45 super(advisor, field, start); 46 this.ctField = field; 47 } 48 49 public FieldSetMatcher(Advisor advisor, Field field, ASTStart start) 50 { 51 super(advisor, field, start); 52 this.field = field; 53 } 54 55 public Object visit(ASTSet node, Object data) 56 { 57 return node.jjtGetChild(0).jjtAccept(this, null); 58 } 59 60 protected Boolean resolvePointcut(Pointcut p) 61 { 62 if (ctField != null) 63 { 64 try 65 { 66 return new Boolean (p.matchesSet(advisor, ctField)); 67 } 68 catch (NotFoundException e) 69 { 70 throw new RuntimeException (e); } 72 } 73 else 74 { 75 return new Boolean (p.matchesSet(advisor, field)); 76 } 77 } 78 } 79 | Popular Tags |