/** Builds the list of extensions, using reflection, from public methods of this class. */ protected ExtensionDescriptor[] buildExtensions() { Method[] m = getClass().getMethods(); ExtensionDescriptor[] desc = new ExtensionDescriptor[m.length]; for (int i = 0; i < m.length; i++) { Class<?>[] c = m[i].getParameterTypes(); int[] types = new int[c.length]; for (int j = 0; j < c.length; j++) { if (c[j] == String.class) types[j] = ARG_STRING; else if (c[j] == Double.class) types[j] = ARG_NUMBER; else if (c[j] == Object[].class) types[j] = ARG_ARRAY; else if (c[j] == String[].class) types[j] = ARG_OUTPUT + ARG_STRING; else if (c[j] == Double[].class) types[j] = ARG_OUTPUT + ARG_NUMBER; } desc[i] = ExtensionDescriptor.newDescriptor(m[i].getName(), this, types); } return desc; }