Search in sources :

Example 1 with Option

use of io.airlift.airline.Option in project activemq-artemis by apache.

the class OptionsUtil method findAllOptions.

private static void findAllOptions(Set<String> options, Class<? extends Action> command) {
    for (Field field : command.getDeclaredFields()) {
        if (field.isAnnotationPresent(Option.class)) {
            Option annotation = field.getAnnotation(Option.class);
            String[] names = annotation.name();
            for (String n : names) {
                options.add(n);
            }
        }
    }
    Class parent = command.getSuperclass();
    if (Action.class.isAssignableFrom(parent)) {
        findAllOptions(options, parent);
    }
}
Also used : Field(java.lang.reflect.Field) Option(io.airlift.airline.Option)

Aggregations

Option (io.airlift.airline.Option)1 Field (java.lang.reflect.Field)1