use of org.apache.qpid.server.plugin.ConfiguredObjectAttributeInjector in project qpid-broker-j by apache.
the class ConfiguredObjectTypeRegistry method processAttributesTypesAndFields.
private <X extends ConfiguredObject> void processAttributesTypesAndFields(final Class<X> clazz) {
Map<String, ConfiguredObjectAttribute<?, ?>> attrMap = new TreeMap<>(NAME_COMPARATOR);
Map<String, AutomatedField> fieldMap = new HashMap<String, AutomatedField>();
Collection<ConfiguredObjectAttribute<?, ?>> attrCol = _allAttributes.get(clazz);
for (ConfiguredObjectAttribute<?, ?> attr : attrCol) {
attrMap.put(attr.getName(), attr);
if (attr.isAutomated()) {
fieldMap.put(attr.getName(), findField(attr, clazz));
}
}
for (ConfiguredObjectAttributeInjector injector : _attributeInjectors) {
for (ConfiguredObjectInjectedAttribute<?, ?> attr : injector.getInjectedAttributes()) {
if (!attrMap.containsKey(attr.getName()) && attr.appliesToConfiguredObjectType((Class<? extends ConfiguredObject<?>>) clazz)) {
attrMap.put(attr.getName(), attr);
}
}
}
_allAttributeTypes.put(clazz, attrMap);
_allAutomatedFields.put(clazz, fieldMap);
}
Aggregations