KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > ejbcore > Utils


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
20 package org.netbeans.modules.j2ee.ejbcore;
21
22 import java.util.ArrayList JavaDoc;
23 import org.netbeans.api.java.source.ElementHandle;
24 import org.netbeans.api.java.source.JavaSource;
25 import org.netbeans.api.project.ant.AntArtifact;
26 import org.netbeans.api.project.ui.OpenProjects;
27 import org.netbeans.modules.j2ee.api.ejbjar.EjbReference;
28 import org.netbeans.modules.j2ee.api.ejbjar.EnterpriseReferenceContainer;
29 import org.netbeans.modules.j2ee.common.queries.api.InjectionTargetQuery;
30 import org.netbeans.modules.j2ee.common.source.AbstractTask;
31 import org.netbeans.modules.j2ee.common.method.MethodModel;
32 import org.netbeans.modules.j2ee.common.method.MethodModelSupport;
33 import org.netbeans.modules.j2ee.dd.api.common.EjbLocalRef;
34 import org.netbeans.modules.j2ee.dd.api.common.EjbRef;
35 import org.netbeans.modules.j2ee.deployment.devmodules.api.J2eeModule;
36 import org.openide.DialogDisplayer;
37 import org.openide.NotifyDescriptor;
38 import org.openide.WizardDescriptor;
39 import javax.swing.*;
40 import java.io.File JavaDoc;
41 import java.io.IOException JavaDoc;
42 import java.util.Arrays JavaDoc;
43 import java.util.List JavaDoc;
44 import java.util.Set JavaDoc;
45 import javax.lang.model.element.Element;
46 import javax.lang.model.element.ExecutableElement;
47 import javax.lang.model.element.Modifier;
48 import javax.lang.model.element.TypeElement;
49 import org.netbeans.api.java.classpath.ClassPath;
50 import org.netbeans.api.java.project.classpath.ProjectClassPathModifier;
51 import org.netbeans.api.java.source.CompilationController;
52 import org.netbeans.api.java.source.WorkingCopy;
53 import org.netbeans.api.project.FileOwnerQuery;
54 import org.netbeans.api.project.Project;
55 import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeAppProvider;
56 import org.netbeans.modules.j2ee.deployment.devmodules.spi.J2eeModuleProvider;
57 import org.netbeans.modules.j2ee.ejbcore.api.methodcontroller.EjbMethodController;
58 import org.openide.filesystems.FileObject;
59
60 public class Utils {
61     
62     private static final String JavaDoc WIZARD_PANEL_CONTENT_DATA = "WizardPanel_contentData"; // NOI18N
63
private static final String JavaDoc WIZARD_PANEL_CONTENT_SELECTED_INDEX = "WizardPanel_contentSelectedIndex"; //NOI18N;
64

65     public static String JavaDoc toClasspathString(File JavaDoc[] classpathEntries) {
66         if (classpathEntries == null) {
67             return "";
68         }
69         StringBuffer JavaDoc classpath = new StringBuffer JavaDoc();
70         for (int i = 0; i < classpathEntries.length; i++) {
71             classpath.append(classpathEntries[i].getAbsolutePath());
72             if (i + 1 < classpathEntries.length) {
73                 classpath.append(':');
74             }
75         }
76         return classpath.toString();
77     }
78     
79     public static void notifyError(Exception JavaDoc exception) {
80         NotifyDescriptor ndd = new NotifyDescriptor.Message(exception.getMessage(), NotifyDescriptor.ERROR_MESSAGE);
81         DialogDisplayer.getDefault().notify(ndd);
82     }
83     
84     public static void mergeSteps(WizardDescriptor wizard, WizardDescriptor.Panel[] panels, String JavaDoc[] steps) {
85         Object JavaDoc prop = wizard.getProperty(WIZARD_PANEL_CONTENT_DATA);
86         String JavaDoc[] beforeSteps;
87         int offset;
88         if (prop instanceof String JavaDoc[]) {
89             beforeSteps = (String JavaDoc[]) prop;
90             offset = beforeSteps.length;
91             if (offset > 0 && ("...".equals(beforeSteps[offset - 1]))) {// NOI18N
92
offset--;
93             }
94         } else {
95             beforeSteps = null;
96             offset = 0;
97         }
98         String JavaDoc[] resultSteps = new String JavaDoc[ (offset) + panels.length];
99         System.arraycopy(beforeSteps, 0, resultSteps, 0, offset);
100         setSteps(panels, steps, resultSteps, offset);
101     }
102     
103     private static void setSteps(WizardDescriptor.Panel[] panels, String JavaDoc[] steps, String JavaDoc[] resultSteps, int offset) {
104         int numberOfSteps = steps == null ? 0 : steps.length;
105         for (int i = 0; i < panels.length; i++) {
106             final JComponent component = (JComponent) panels[i].getComponent();
107             String JavaDoc step = i < numberOfSteps ? steps[i] : null;
108             if (step == null) {
109                 step = component.getName();
110             }
111             component.putClientProperty(WIZARD_PANEL_CONTENT_DATA, resultSteps);
112             component.putClientProperty(WIZARD_PANEL_CONTENT_SELECTED_INDEX, Integer.valueOf(i));
113             component.getAccessibleContext().setAccessibleDescription(step);
114             resultSteps[i + offset] = step;
115         }
116     }
117     
118     public static void setSteps(WizardDescriptor.Panel[] panels, String JavaDoc[] steps) {
119         setSteps(panels, steps, steps, 0);
120     }
121     
122     public static boolean areInSameJ2EEApp(Project project1, Project project2) {
123         Project[] openProjects = OpenProjects.getDefault().getOpenProjects();
124         for (int i = 0; i < openProjects.length; i++) {
125             Project project = openProjects[i];
126             Object JavaDoc j2eeAppProvider = project.getLookup().lookup(J2eeAppProvider.class);
127             if (j2eeAppProvider != null) { // == it is j2ee app
128
J2eeAppProvider j2eeApp = (J2eeAppProvider)j2eeAppProvider;
129                 J2eeModuleProvider[] j2eeModules = j2eeApp.getChildModuleProviders();
130                 if ((j2eeModules != null) && (j2eeModules.length > 0)) { // == there are some modules in the j2ee app
131
J2eeModuleProvider affectedPrjProvider1 =
132                             (J2eeModuleProvider)project1.getLookup().lookup(J2eeModuleProvider.class);
133                     J2eeModuleProvider affectedPrjProvider2 =
134                             (J2eeModuleProvider)project2.getLookup().lookup(J2eeModuleProvider.class);
135                     if (affectedPrjProvider1 != null && affectedPrjProvider2 != null) {
136                         List JavaDoc childModules = Arrays.asList(j2eeModules);
137                         if (childModules.contains(affectedPrjProvider1) &&
138                                 childModules.contains(affectedPrjProvider2)) {
139                             return true;
140                         }
141                     }
142                 }
143             }
144         }
145         return false;
146     }
147     
148     // =========================================================================
149

150     // utils for ejb code synchronization
151

152     public static boolean canExposeInLocal(FileObject ejbClassFO, final ElementHandle<ExecutableElement> methodHandle) throws IOException JavaDoc {
153         JavaSource javaSource = JavaSource.forFileObject(ejbClassFO);
154         final String JavaDoc[] ejbClassName = new String JavaDoc[1];
155         final MethodModel[] methodModel = new MethodModel[1];
156         javaSource.runModificationTask(new AbstractTask<WorkingCopy>() {
157             public void run(WorkingCopy workingCopy) throws IOException JavaDoc {
158                 workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
159                 ExecutableElement executableElement = methodHandle.resolve(workingCopy);
160                 Set JavaDoc<Modifier> modifiers = executableElement.getModifiers();
161                 boolean signatureOk = modifiers.contains(Modifier.PUBLIC) && !modifiers.contains(Modifier.STATIC);
162                 if (signatureOk) {
163                     Element enclosingElement = executableElement.getEnclosingElement();
164                     ejbClassName[0] = ((TypeElement) enclosingElement).getQualifiedName().toString();
165                     methodModel[0] = MethodModelSupport.createMethodModel(workingCopy, executableElement);
166                 }
167             }
168         });
169         if (methodModel[0] != null) {
170             EjbMethodController ejbMethodController = EjbMethodController.createFromClass(ejbClassFO, ejbClassName[0]);
171             return ejbMethodController != null && ejbMethodController.hasLocal() && !ejbMethodController.hasMethodInInterface(methodModel[0], ejbMethodController.getMethodTypeFromImpl(methodModel[0]), true);
172         }
173         return false;
174     }
175     
176     public static void exposeInLocal(FileObject ejbClassFO, final ElementHandle<ExecutableElement> methodHandle) throws IOException JavaDoc {
177         JavaSource javaSource = JavaSource.forFileObject(ejbClassFO);
178         final String JavaDoc[] ejbClassName = new String JavaDoc[1];
179         final MethodModel[] methodModel = new MethodModel[1];
180         javaSource.runModificationTask(new AbstractTask<WorkingCopy>() {
181             public void run(WorkingCopy workingCopy) throws IOException JavaDoc {
182                 workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
183                 ExecutableElement method = methodHandle.resolve(workingCopy);
184                 Element enclosingElement = method.getEnclosingElement();
185                 ejbClassName[0] = ((TypeElement) enclosingElement).getQualifiedName().toString();
186                 methodModel[0] = MethodModelSupport.createMethodModel(workingCopy, method);
187             }
188         });
189         EjbMethodController ejbMethodController = EjbMethodController.createFromClass(ejbClassFO, ejbClassName[0]);
190         ejbMethodController.createAndAddInterface(methodModel[0], true);
191     }
192     
193     public static boolean canExposeInRemote(FileObject ejbClassFO, final ElementHandle<ExecutableElement> methodHandle) throws IOException JavaDoc {
194         JavaSource javaSource = JavaSource.forFileObject(ejbClassFO);
195         final String JavaDoc[] ejbClassName = new String JavaDoc[1];
196         final MethodModel[] methodModel = new MethodModel[1];
197         javaSource.runModificationTask(new AbstractTask<WorkingCopy>() {
198             public void run(WorkingCopy workingCopy) throws IOException JavaDoc {
199                 workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
200                 ExecutableElement executableElement = methodHandle.resolve(workingCopy);
201                 Set JavaDoc<Modifier> modifiers = executableElement.getModifiers();
202                 boolean signatureOk = modifiers.contains(Modifier.PUBLIC) && !modifiers.contains(Modifier.STATIC);
203                 if (signatureOk) {
204                     Element enclosingElement = executableElement.getEnclosingElement();
205                     ejbClassName[0] = ((TypeElement) enclosingElement).getQualifiedName().toString();
206                     methodModel[0] = MethodModelSupport.createMethodModel(workingCopy, executableElement);
207                 }
208             }
209         });
210         if (methodModel[0] != null) {
211             EjbMethodController ejbMethodController = EjbMethodController.createFromClass(ejbClassFO, ejbClassName[0]);
212             return ejbMethodController != null && ejbMethodController.hasRemote() && !ejbMethodController.hasMethodInInterface(methodModel[0], ejbMethodController.getMethodTypeFromImpl(methodModel[0]), true);
213         }
214         return false;
215     }
216     
217     public static void exposeInRemote(FileObject ejbClassFO, final ElementHandle<ExecutableElement> methodHandle) throws IOException JavaDoc {
218         JavaSource javaSource = JavaSource.forFileObject(ejbClassFO);
219         final String JavaDoc[] ejbClassName = new String JavaDoc[1];
220         final MethodModel[] methodModel = new MethodModel[1];
221         javaSource.runModificationTask(new AbstractTask<WorkingCopy>() {
222             public void run(WorkingCopy workingCopy) throws IOException JavaDoc {
223                 workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
224                 ExecutableElement method = methodHandle.resolve(workingCopy);
225                 Element enclosingElement = method.getEnclosingElement();
226                 ejbClassName[0] = ((TypeElement) enclosingElement).getQualifiedName().toString();
227                 methodModel[0] = MethodModelSupport.createMethodModel(workingCopy, method);
228             }
229         });
230         EjbMethodController ejbMethodController = EjbMethodController.createFromClass(ejbClassFO, ejbClassName[0]);
231         ejbMethodController.createAndAddInterface(methodModel[0], false);
232     }
233     
234     public static void addReference(FileObject fileObject, String JavaDoc className, EjbReference ref, String JavaDoc serviceLocator, boolean remote,
235             boolean throwExceptions, String JavaDoc ejbRefName, Project nodeProject) throws IOException JavaDoc {
236         // find the project containing the source file
237
Project enterpriseProject = FileOwnerQuery.getOwner(fileObject);
238         EnterpriseReferenceContainer erc = (EnterpriseReferenceContainer)
239         enterpriseProject.getLookup().lookup(EnterpriseReferenceContainer.class);
240
241         boolean enterpriseProjectIsJavaEE5 = isJavaEE5orHigher(enterpriseProject);
242         boolean nodeProjectIsJavaEE5 = isJavaEE5orHigher(nodeProject);
243
244         if (remote) {
245             EjbRef ejbRef = ref.createRef();
246             if (ejbRefName != null) {
247                 ejbRef.setEjbRefName(ejbRefName);
248             }
249             if (enterpriseProjectIsJavaEE5 && InjectionTargetQuery.isInjectionTarget(fileObject, className)) {
250                 addProjectToClassPath(enterpriseProject, ref);
251             } else if (nodeProjectIsJavaEE5 == enterpriseProjectIsJavaEE5){ // see #75876
252
erc.addEjbReference(ejbRef, fileObject, className, ref.getClientJarTarget());
253             }
254             if (serviceLocator == null) {
255                 //TODO: RETOUCHE resolve EjbReference signatures
256
// ref.generateReferenceCode(fileObject, className, ejbRef, throwExceptions);
257
ref.generateReferenceCode(fileObject, ejbRef, throwExceptions);
258             } else {
259                 //TODO: RETOUCHE resolve EjbReference signatures
260
// ref.generateServiceLocatorLookup(fileObject, className, ejbRef, serviceLocator, throwExceptions);
261
ref.generateServiceLocatorLookup(fileObject, ejbRef, serviceLocator, throwExceptions);
262             }
263         } else {
264             EjbLocalRef ejbLocalRef = ref.createLocalRef();
265             if (ejbRefName != null) {
266                 ejbLocalRef.setEjbRefName(ejbRefName);
267             }
268             if (enterpriseProjectIsJavaEE5 && InjectionTargetQuery.isInjectionTarget(fileObject, className)) {
269                 addProjectToClassPath(enterpriseProject, ref);
270             } else if (nodeProjectIsJavaEE5 == enterpriseProjectIsJavaEE5){ // see #75876
271
erc.addEjbLocalReference(ejbLocalRef, fileObject, className, ref.getClientJarTarget());
272             }
273             if (serviceLocator == null) {
274                 //TODO: RETOUCHE resolve EjbReference signatures
275
// ref.generateReferenceCode(fileObject, className, ejbLocalRef, throwExceptions);
276
ref.generateReferenceCode(fileObject, ejbLocalRef, throwExceptions);
277             } else {
278                 //TODO: RETOUCHE resolve EjbReference signatures
279
// ref.generateServiceLocatorLookup(fileObject, className, ejbLocalRef, serviceLocator, throwExceptions);
280
ref.generateServiceLocatorLookup(fileObject, ejbLocalRef, serviceLocator, throwExceptions);
281             }
282         }
283         if (serviceLocator != null) {
284             erc.setServiceLocatorName(serviceLocator);
285         }
286     }
287     
288     private static void addProjectToClassPath(final Project enterpriseProject, final EjbReference ref) throws IOException JavaDoc {
289         AntArtifact target = ref.getClientJarTarget();
290         boolean differentProject = target != null && !enterpriseProject.equals(target.getProject());
291         if (differentProject) {
292             ProjectClassPathModifier cpModifier = enterpriseProject.getLookup().lookup(ProjectClassPathModifier.class);
293             if (cpModifier != null) {
294                 cpModifier.addAntArtifacts(
295                         new AntArtifact[] {target},
296                         target.getArtifactLocations(),
297                         enterpriseProject.getProjectDirectory(),
298                         ClassPath.COMPILE
299                         );
300             }
301         }
302     }
303     
304     /** Returns list of all EJB projects that can be called from the caller project.
305      *
306      * @param enterpriseProject the caller enterprise project
307      */

308     public static Project [] getCallableEjbProjects(Project enterpriseProject) {
309         Project[] allProjects = OpenProjects.getDefault().getOpenProjects();
310         
311         // TODO: HACK - this must be solved by freeform's own implementation of EnterpriseReferenceContainer, see issue 57003
312
// call ejb should not make this check, all should be handled in EnterpriseReferenceContainer
313
boolean isCallerFreeform = enterpriseProject.getClass().getName().equals("org.netbeans.modules.ant.freeform.FreeformProject");
314         
315         List JavaDoc<Project> filteredResults = new ArrayList JavaDoc<Project>(allProjects.length);
316         for (int i = 0; i < allProjects.length; i++) {
317             boolean isEJBModule = false;
318             J2eeModuleProvider j2eeModuleProvider = allProjects[i].getLookup().lookup(J2eeModuleProvider.class);
319             if (j2eeModuleProvider != null && j2eeModuleProvider.getJ2eeModule().getModuleType().equals(J2eeModule.EJB)) {
320                 isEJBModule = true;
321             }
322             if ((isEJBModule && !isCallerFreeform) ||
323                     (isCallerFreeform && enterpriseProject.equals(allProjects[i]))) {
324                 filteredResults.add(allProjects[i]);
325             }
326         }
327         return filteredResults.toArray(new Project[filteredResults.size()]);
328     }
329     
330 //TODO: this method should be removed and org.netbeans.modules.j2ee.common.Util.isJavaEE5orHigher(Project project)
331
//should be called instead of it
332
public static boolean isJavaEE5orHigher(Project project) {
333         if (project == null) {
334             return false;
335         }
336         J2eeModuleProvider j2eeModuleProvider = (J2eeModuleProvider) project.getLookup().lookup(J2eeModuleProvider.class);
337         if (j2eeModuleProvider != null) {
338             J2eeModule j2eeModule = j2eeModuleProvider.getJ2eeModule();
339             if (j2eeModule != null) {
340                 Object JavaDoc type = j2eeModule.getModuleType();
341                 double version = Double.parseDouble(j2eeModule.getModuleVersion());
342                 if (J2eeModule.EJB.equals(type) && (version > 2.1)) {
343                     return true;
344                 }
345                 if (J2eeModule.WAR.equals(type) && (version > 2.4)) {
346                     return true;
347                 }
348                 if (J2eeModule.CLIENT.equals(type) && (version > 1.4)) {
349                     return true;
350                 }
351             }
352         }
353         return false;
354     }
355     
356     public static boolean isAppClient(Project project) {
357         J2eeModuleProvider module = (J2eeModuleProvider) project.getLookup().lookup(J2eeModuleProvider.class);
358         return (module != null) ? module.getJ2eeModule().getModuleType().equals(J2eeModule.CLIENT) : false;
359     }
360     
361     /**
362      * @return true if given <code>target</code> is defined in a Java SE environment.
363      */

364     public static boolean isTargetJavaSE(FileObject fileObject, final String JavaDoc className) throws IOException JavaDoc{
365         Project owner = FileOwnerQuery.getOwner(fileObject);
366         if (owner.getLookup().lookup(J2eeModuleProvider.class) == null){
367             return true;
368         }
369         JavaSource javaSource = JavaSource.forFileObject(fileObject);
370         final boolean[] result = new boolean[] { false };
371         javaSource.runUserActionTask(new AbstractTask<CompilationController>() {
372             public void run(CompilationController controller) throws IOException JavaDoc {
373                 controller.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
374                 TypeElement typeElement = controller.getElements().getTypeElement(className);
375                 TypeElement junitTestCase = controller.getElements().getTypeElement("junit.framework.TestCase");
376                 if (junitTestCase != null) {
377                     result[0] = controller.getTypes().isSubtype(typeElement.asType(), junitTestCase.asType());
378                 }
379             }
380         }, true);
381         return result[0];
382     }
383     
384 // /**
385
// * @return true if given <code>javaClass</code> is a subtype (direct or
386
// * indirect) of <code>junit.framework.TestCase</code>.
387
// */
388
// private static boolean extendsTestCase(CompilationController controller, TypeElement typeElement){
389
// if (typeElement == null){
390
// return false;
391
// }
392
// if (typeElement.getQualifiedName().contentEquals("junit.framework.TestCase")){
393
// return true;
394
// }
395
// DeclaredType superClassType = (DeclaredType) typeElement.getSuperclass();
396
// return extendsTestCase(controller, (TypeElement) superClassType.asElement());
397
// }
398

399     /**
400      * Converts the given <code>jndiName</code> to camel case, i.e. removes
401      * all <code>/</code> characters and converts characters to upper case appropriately.
402      * For example, returns <code>SomeJndiName</code> for <code>some/jndi/name</code> or
403      * <code>someJndiName</code> if <code>lowerCaseFirstChar</code> is true.
404      * @param jndiName the JNDI name to convert; must not be null.
405      * @param lowerCaseFirstChar defines whether the first char of the resulting name
406      * should be lower case (note that if all chars of the given <code>jndiName</code> are
407      * uppercase characters, its first char will not be converted to lower case even
408      * if this param is true).
409      * @param prefixToStrip the prefix that will be stripped from the resulting name. If null,
410      * nothing will be stripped.
411      * @return String representing the converted name.
412      */

413     public static String JavaDoc jndiNameToCamelCase(String JavaDoc jndiName, boolean lowerCaseFirstChar, String JavaDoc prefixToStrip){
414         
415         String JavaDoc strippedJndiName = jndiName;
416         if (prefixToStrip != null && jndiName.startsWith(prefixToStrip)){
417             strippedJndiName = jndiName.substring(jndiName.indexOf(prefixToStrip) + prefixToStrip.length());
418         }
419         
420         StringBuilder JavaDoc result = new StringBuilder JavaDoc();
421         
422         for (String JavaDoc token : strippedJndiName.split("/")){
423             if (token.length() == 0){
424                 continue;
425             }
426             char firstChar = token.charAt(0);
427             if (lowerCaseFirstChar && result.length() == 0 && !isAllUpperCase(token)){
428                 firstChar = Character.toLowerCase(firstChar);
429             } else {
430                 firstChar = Character.toUpperCase(firstChar);
431             }
432             result.append(firstChar);
433             result.append(token.substring(1));
434         }
435         
436         return result.toString();
437     }
438     
439     /**
440      * @return true if the given <code>str</code> has more than one char
441      * and all its chars are uppercase, false otherwise.
442      */

443     private static boolean isAllUpperCase(String JavaDoc str){
444         if (str.length() <= 1){
445             return false;
446         }
447         for (char c : str.toCharArray()) {
448             if (Character.isLowerCase(c)){
449                 return false;
450             }
451         }
452         return true;
453     }
454
455 // public static ExecutableElement[] getMethods(EjbMethodController c, boolean checkLocal, boolean checkRemote) {
456
// List<ExecutableElement> methods = new ArrayList<ExecutableElement>();
457
// List features;
458
// for (ExecutableElement method : ElementFilter.methodsIn(c.getBeanClass().getEnclosedElements())) {
459
// methods.add(method);
460
// }
461
// if (checkLocal) {
462
// for (TypeElement interfaceCE : c.getLocalInterfaces()) {
463
// for (ExecutableElement method : ElementFilter.methodsIn(interfaceCE.getEnclosedElements())) {
464
// methods.add(method);
465
// }
466
// }
467
// }
468
// if (checkRemote) {
469
// for (TypeElement interfaceCE : c.getRemoteInterfaces()) {
470
// for (ExecutableElement method : ElementFilter.methodsIn(interfaceCE.getEnclosedElements())) {
471
// methods.add(method);
472
// }
473
// }
474
// }
475
// ExecutableElement[] methodsArray = methods.toArray(new ExecutableElement[methods.size()]);
476
// return methodsArray;
477
// }
478

479 }
480
Popular Tags