private void addFunctions(Class<?> clazz, String prefix) { Method[] methods = clazz.getMethods(); //need a consistent order for tests Arrays.sort(methods, new Comparator<Method>() { @Override public int compare(Method arg0, Method arg1) { return arg0.toGenericString().compareTo(arg1.toGenericString()); } }); for (Method method : methods) { TeiidFunction f = method.getAnnotation(TeiidFunction.class); if (f == null) { continue; } String name = f.name(); if (name.isEmpty()) { name = method.getName(); } if (prefix != null) { name = prefix + name; } addFunction(method, f, name); if (!f.alias().isEmpty()) { addFunction(method, f, f.alias()); } } }
private void addFunctions(Class<?> clazz, String prefix) { Method[] methods = clazz.getMethods(); //need a consistent order for tests Arrays.sort(methods, new Comparator<Method>() { @Override public int compare(Method arg0, Method arg1) { return arg0.toGenericString().compareTo(arg1.toGenericString()); } }); for (Method method : methods) { TeiidFunction f = method.getAnnotation(TeiidFunction.class); if (f == null) { continue; } String name = f.name(); if (name.isEmpty()) { name = method.getName(); } if (prefix != null) { name = prefix + name; } addFunction(method, f, name); if (!f.alias().isEmpty()) { addFunction(method, f, f.alias()); } } }
private void addFunctions(Class<?> clazz, String prefix) { Method[] methods = clazz.getMethods(); //need a consistent order for tests Arrays.sort(methods, new Comparator<Method>() { @Override public int compare(Method arg0, Method arg1) { return arg0.toGenericString().compareTo(arg1.toGenericString()); } }); for (Method method : methods) { TeiidFunction f = method.getAnnotation(TeiidFunction.class); if (f == null) { continue; } String name = f.name(); if (name.isEmpty()) { name = method.getName(); } if (prefix != null) { name = prefix + name; } addFunction(method, f, name); if (!f.alias().isEmpty()) { addFunction(method, f, f.alias()); } } }