Search in sources :

Example 1 with CommandDefinition

use of org.aesh.command.CommandDefinition in project wildfly-core by wildfly.

the class HelpSupport method retrieveDeprecated.

private static void retrieveDeprecated(Set<String> deprecated, Class clazz, List<String> superNames) {
    for (Field field : clazz.getDeclaredFields()) {
        processField(deprecated, field);
    }
    if (clazz.getSuperclass() != null) {
        Class<?> sup = clazz.getSuperclass();
        if (sup.getAnnotation(CommandDefinition.class) != null) {
            CommandDefinition cd = (CommandDefinition) sup.getAnnotation(CommandDefinition.class);
            superNames.add(cd.name());
        }
        if (sup.getAnnotation(GroupCommandDefinition.class) != null) {
            GroupCommandDefinition gcd = (GroupCommandDefinition) sup.getAnnotation(GroupCommandDefinition.class);
            superNames.add(gcd.name());
        }
        retrieveDeprecated(deprecated, sup, superNames);
    }
}
Also used : Field(java.lang.reflect.Field) GroupCommandDefinition(org.aesh.command.GroupCommandDefinition) CommandDefinition(org.aesh.command.CommandDefinition) GroupCommandDefinition(org.aesh.command.GroupCommandDefinition)

Aggregations

Field (java.lang.reflect.Field)1 CommandDefinition (org.aesh.command.CommandDefinition)1 GroupCommandDefinition (org.aesh.command.GroupCommandDefinition)1