KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > lifecycle > Procedures


1 /*****************************************************************************
2  * Copyright (C) Zephyr Business Solution. All rights reserved. *
3  * ------------------------------------------------------------------------- *
4  * The software in this package is published under the terms of the BSD *
5  * style license a copy of which has been included with this distribution in *
6  * the LICENSE.txt file. *
7  *****************************************************************************/

8
9 /*
10  * Created on Oct 13, 2005
11  *
12  * Author Michelle Lei
13  * ZBS
14  */

15 package jfun.yan.lifecycle;
16
17 import java.lang.reflect.Method JavaDoc;
18
19 /**
20  * <p>
21  * Facade class providing some useful Procedure implementations.
22  * </p>
23  * Zephyr Business Solution
24  *
25  * @author Michelle Lei
26  *
27  */

28 public class Procedures {
29   /**
30    * Creates a procedure that invokes a method of a certain signature.
31    * @param name the method name.
32    * @param param_types the parameter types.
33    * @return the Procedure object.
34    */

35   public static Procedure method(String JavaDoc name, Class JavaDoc[] param_types){
36     return new MethodNameProcedure(name, param_types);
37   }
38   /**
39    * Creates a procedure that invokes a parameter-less method of a certain name.
40    * @param name the method name.
41    * @return the Procedure object.
42    */

43   public static Procedure method(String JavaDoc name){
44     return method(name, null);
45   }
46   /**
47    * Creates a procedure that encapsulates a method.
48    * @param mtd the method object.
49    * @return the Procedure object.
50    */

51   public static Procedure method(Method JavaDoc mtd){
52     return new MethodProcedure(mtd);
53   }
54 }
55
Popular Tags