KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > core > ControlFlow


1 /*
2  * Copyright 2002-2005 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.core;
18
19 /**
20  * Interface to be implemented by objects that can return information about
21  * the current call stack. Useful in AOP (as in AspectJ cflow concept)
22  * but not AOP-specific.
23  *
24  * @author Rod Johnson
25  * @since 02.02.2004
26  */

27 public interface ControlFlow {
28
29     /**
30      * Detect whether we're under the given class,
31      * according to the current stack trace.
32      * @param clazz the clazz to look for
33      */

34     boolean under(Class JavaDoc clazz);
35
36     /**
37      * Detect whether we're under the given class and method,
38      * according to the current stack trace.
39      * @param clazz the clazz to look for
40      * @param methodName the name of the method to look for
41      */

42     boolean under(Class JavaDoc clazz, String JavaDoc methodName);
43
44     /**
45      * Detect whether the current stack trace contains the given token.
46      * @param token the token to look for
47      */

48     boolean underToken(String JavaDoc token);
49
50 }
51
Popular Tags