/** * Gets the configuration options supported by the component. This allows e.g. to * automatically build user interfaces for configuring components. * @param component Name of the component. * @param allInfo Whether or not complete information is desired (including option description, required, default value, example value). * @return A list of configuration options supported by the component. * @throws UnknownComponentException Thrown if component is not known (see {@link #getComponents()}). */ @WebMethod public String[] getConfigOptions(String component, boolean allInfo) { Class<? extends Component> componentClass = cm.getComponentClass(component); Set<Field> options = AnnComponentManager.getConfigOptions(componentClass); String[] optionsString = new String[options.size()]; int i = 0; for(Field f : options) { ConfigOption option = f.getAnnotation(ConfigOption.class); optionsString[i] = AnnComponentManager.getName(f); if(allInfo) { optionsString[i] += "#" + option.description(); optionsString[i] += "#" + option.required(); optionsString[i] += "#" + option.defaultValue(); optionsString[i] += "#" + option.exampleValue(); } i++; } return optionsString; }