Search in sources :

Example 1 with Configurables

use of org.wildfly.swarm.spi.api.annotations.Configurables in project wildfly-swarm by wildfly-swarm.

the class ConfigurableManager method namesFor.

protected List<ConfigKey> namesFor(ConfigKey prefix, Field field) {
    List<ConfigKey> names = new ArrayList<>();
    Configurables plural = field.getAnnotation(Configurables.class);
    if (plural != null) {
        for (Configurable each : plural.value()) {
            ConfigKey key = nameFor(prefix, each);
            if (key != null) {
                names.add(key);
            }
        }
    } else {
        Configurable[] annos = field.getAnnotationsByType(Configurable.class);
        if (annos != null && annos.length > 0) {
            for (Configurable anno : annos) {
                ConfigKey key = nameFor(prefix, anno);
                if (key != null) {
                    names.add(key);
                }
            }
        } else {
            ConfigKey key = handleDeploymentConfiguration(prefix.append(nameFor(field)));
            names.add(key);
        }
    }
    return names;
}
Also used : Configurables(org.wildfly.swarm.spi.api.annotations.Configurables) ConfigKey(org.wildfly.swarm.spi.api.config.ConfigKey) ArrayList(java.util.ArrayList) Configurable(org.wildfly.swarm.spi.api.annotations.Configurable)

Aggregations

ArrayList (java.util.ArrayList)1 Configurable (org.wildfly.swarm.spi.api.annotations.Configurable)1 Configurables (org.wildfly.swarm.spi.api.annotations.Configurables)1 ConfigKey (org.wildfly.swarm.spi.api.config.ConfigKey)1