KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > ejb > cfg > QueryMethod


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.ejb.cfg;
30
31 import com.caucho.config.ConfigException;
32 import com.caucho.util.L10N;
33
34 import java.util.ArrayList JavaDoc;
35
36 /**
37  * <pre>
38  * query-method ::= (method-name, method-params)
39  * </pre>
40  */

41 public class QueryMethod {
42   private static L10N L = new L10N(QueryMethod.class);
43
44   private MethodSignature _signature;
45   
46   private String JavaDoc _methodName;
47   
48   private ArrayList JavaDoc _methodParams;
49
50   public QueryMethod()
51   {
52     _signature = new MethodSignature();
53   }
54
55   public void setValue(String JavaDoc id)
56     throws ConfigException
57   {
58     _signature.setName(id);
59   }
60
61   public void setId(String JavaDoc id)
62     throws ConfigException
63   {
64     _signature.setName(id);
65   }
66
67   public void setMethodName(String JavaDoc methodName)
68     throws ConfigException
69   {
70     _signature.setName(methodName);
71   }
72
73   public void setMethodParams(MethodParams methodParams)
74   {
75   }
76
77   public MethodSignature getSignature()
78   {
79     return _signature;
80   }
81
82   public static class MethodParams {
83     private ArrayList JavaDoc _methodParams = new ArrayList JavaDoc();
84     
85     public void addMethodParam(String JavaDoc param)
86       throws ConfigException
87     {
88       if (param.equals(""))
89         throw new ConfigException(L.l("method-param must not be empty."));
90     }
91   }
92 }
93
Popular Tags