1 22 package org.jboss.aop.pointcut; 23 24 import java.util.ArrayList ; 25 26 33 public class CFlowStack 34 { 35 private String name; 36 private ArrayList cflows = new ArrayList (); 37 38 public CFlowStack(String name) 39 { 40 this.name = name; 41 } 42 43 public String getName() 44 { 45 return name; 46 } 47 48 public void addCFlow(org.jboss.aop.pointcut.CFlow cflow) 49 { 50 cflows.add(cflow); 51 } 52 53 public boolean matches(StackTraceElement [] stack) 54 { 55 int stackIndex = stack.length - 1; 56 for (int i = 0; i < cflows.size(); i++) 57 { 58 org.jboss.aop.pointcut.CFlow cflow = (org.jboss.aop.pointcut.CFlow)cflows.get(i); 59 stackIndex = cflow.matches(stack, stackIndex); 60 if (stackIndex == org.jboss.aop.pointcut.CFlow.NOT_FOUND) 61 { 62 return false; 63 } 64 if (stackIndex == -1 && i + 1 < cflows.size()) return false; 65 } 66 return true; 67 } 68 69 } 70 | Popular Tags |