MCPcopy Create free account
hub / github.com/GateNLP/gate-core / featuresClass

Method featuresClass

src/main/java/gate/creole/BootStrap.java:216–248  ·  view source on GitHub ↗

go through all methods and determines return type, parameters, exceptions

(Class<?> currentClass, List<FeatureMethod> methodsList)

Source from the content-addressed store, hash-verified

214
215 /**go through all methods and determines return type, parameters, exceptions*/
216 public List<FeatureMethod> featuresClass (Class<?> currentClass, List<FeatureMethod> methodsList){
217
218 // go through all the methods
219 Method[] listMethodsCurrentClass = currentClass.getMethods();
220 for (int i=0;i<listMethodsCurrentClass.length;i++) {
221 FeatureMethod featureMethod = new FeatureMethod();
222 featureMethod.setNameMethod(listMethodsCurrentClass[i].getName());
223 featureMethod.setValueReturn(
224 listMethodsCurrentClass[i].getReturnType().getName());
225
226 Class<?>[] parameters = (
227 listMethodsCurrentClass[i].getParameterTypes());
228 Class<?>[] exceptions = (
229 listMethodsCurrentClass[i].getExceptionTypes());
230
231 // determine the parameters for the current method
232 List<String> aux = new ArrayList<String>();
233 for (int k=0;k<parameters.length;k++)
234 aux.add(parameters[k].getName());
235 featureMethod.setParameterTypes(aux);
236
237 // determine the exceptions for the current method
238 aux = new ArrayList<String>();
239 for (int k=0;k<exceptions.length;k++)
240 aux.add(exceptions[k].getName());
241 featureMethod.setExceptionTypes(aux);
242
243 if (!methodsList.contains(featureMethod)){
244 methodsList.add(featureMethod);
245 }
246 }// for
247 return methodsList;
248 }// List featureClass (Class currentClass)
249
250 /** create the form for the methods from the class that create the resource
251 * @param methodsExtendList is the list with all methods from the class that extends

Callers 1

getInterfacesAndClassMethod · 0.95

Calls 9

setNameMethodMethod · 0.95
setValueReturnMethod · 0.95
setParameterTypesMethod · 0.95
setExceptionTypesMethod · 0.95
getParameterTypesMethod · 0.80
getExceptionTypesMethod · 0.80
getNameMethod · 0.65
addMethod · 0.65
containsMethod · 0.45

Tested by

no test coverage detected