KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > common > method > MethodCustomizerFactory


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.netbeans.modules.j2ee.common.method;
20
21 import java.util.Collection JavaDoc;
22
23 /**
24  * Provide a factory for obtaining MethodCustomizer instances
25  *
26  * @author Chris Webster
27  * @author Martin Adamek
28  */

29 public final class MethodCustomizerFactory {
30
31     private MethodCustomizerFactory() {}
32     
33     public static MethodCustomizer businessMethod(String JavaDoc title, MethodModel method, boolean remote, boolean local, boolean selectLocal, boolean selectRemote, Collection JavaDoc<MethodModel> existingMethods) {
34         return new MethodCustomizer(
35                 title,
36                 method,
37                 local,
38                 remote,
39                 selectLocal,
40                 selectRemote,
41                 true, // return type
42
null, // EJB QL
43
false, // finder cardinality
44
true, // exceptions
45
true, // interfaces
46
null, // prefix
47
existingMethods
48                 );
49     }
50     
51     public static MethodCustomizer homeMethod(String JavaDoc title, MethodModel method, boolean remote, boolean local, boolean selectLocal, boolean selectRemote, Collection JavaDoc<MethodModel> existingMethods) {
52         return new MethodCustomizer(
53                 title,
54                 method,
55                 local,
56                 remote,
57                 selectLocal,
58                 selectRemote,
59                 true, // return type
60
null, // EJB QL
61
false, // finder cardinality
62
true, // exceptions
63
true, // interfaces
64
null, // prefix
65
existingMethods
66                 );
67     }
68     
69     public static MethodCustomizer createMethod(String JavaDoc title, MethodModel method, boolean remote, boolean local, boolean selectLocal, boolean selectRemote, Collection JavaDoc<MethodModel> existingMethods) {
70         return new MethodCustomizer(
71                 title,
72                 method,
73                 local,
74                 remote,
75                 selectLocal,
76                 selectRemote,
77                 false, // return type
78
null, // EJB QL
79
false, // finder cardinality
80
true, // exceptions
81
true, // interfaces
82
"create", // prefix
83
existingMethods
84                 );
85     }
86     
87     public static MethodCustomizer finderMethod(String JavaDoc title, MethodModel method, boolean remote, boolean local, boolean selectLocal, boolean selectRemote, String JavaDoc ejbql, Collection JavaDoc<MethodModel> existingMethods) {
88         return new MethodCustomizer(
89                 title,
90                 method,
91                 local,
92                 remote,
93                 selectLocal,
94                 selectRemote,
95                 false, // return type
96
ejbql, // EJB QL
97
true, // finder cardinality
98
false, // exceptions
99
true, // interfaces
100
"find", // prefix
101
existingMethods
102                 );
103     }
104     
105     public static MethodCustomizer operationMethod(String JavaDoc title, MethodModel method, Collection JavaDoc<MethodModel> existingMethods) {
106         return new MethodCustomizer(
107                 title,
108                 method,
109                 true, // doesn't matter? interfaces selections is disabled
110
true, // doesn't matter? interfaces selections is disabled
111
true, // doesn't matter? interfaces selections is disabled
112
true, // doesn't matter? interfaces selections is disabled
113
true, // return type
114
null, // EJB QL
115
false, // finder cardinality
116
true, // exceptions
117
false, // interfaces
118
null, // prefix
119
existingMethods
120                 );
121     }
122     
123     public static MethodCustomizer selectMethod(String JavaDoc title, MethodModel method, String JavaDoc ejbql, Collection JavaDoc<MethodModel> existingMethods) {
124         return new MethodCustomizer(
125                 title,
126                 method,
127                 false, // doesn't matter? interfaces selections is disabled
128
false, // doesn't matter? interfaces selections is disabled
129
false, // doesn't matter? interfaces selections is disabled
130
false, // doesn't matter? interfaces selections is disabled
131
true, // return type
132
ejbql, // EJB QL
133
false, // finder cardinality
134
false, // exceptions
135
false, // interfaces
136
"ejbSelect", // prefix
137
existingMethods
138                 );
139     }
140     
141 }
142
Popular Tags