use of io.fabric8.api.jmx.MetaTypeAttributeDTO in project fabric8 by jboss-fuse.
the class ProfileMetadata method createMetaTypeObjectDTO.
protected static MetaTypeObjectDTO createMetaTypeObjectDTO(Properties resources, OCD ocd) {
MetaTypeObjectDTO answer = new MetaTypeObjectDTO();
answer.setId(ocd.getID());
answer.setName(localize(resources, ocd.getName()));
answer.setDescription(localize(resources, ocd.getDescription()));
List<MetaTypeAttributeDTO> attributeList = new ArrayList<>();
Map<String, Object> attributes = ocd.getAttributeDefinitions();
if (attributes != null) {
Set<Map.Entry<String, Object>> entries = attributes.entrySet();
for (Map.Entry<String, Object> entry : entries) {
String name = entry.getKey();
Object value = entry.getValue();
if (value instanceof AD) {
AD ad = (AD) value;
MetaTypeAttributeDTO attributeDTO = createMetaTypeAttributeDTO(resources, ocd, name, ad);
if (attributeDTO != null) {
attributeList.add(attributeDTO);
}
}
}
}
answer.setAttributes(attributeList);
return answer;
}
use of io.fabric8.api.jmx.MetaTypeAttributeDTO in project fabric8 by jboss-fuse.
the class ProfileMetadata method createMetaTypeAttributeDTO.
protected static MetaTypeAttributeDTO createMetaTypeAttributeDTO(Properties resources, OCD ocd, String name, AD ad) {
MetaTypeAttributeDTO answer = new MetaTypeAttributeDTO();
answer.setId(ad.getID());
answer.setName(localize(resources, ad.getName()));
answer.setDescription(localize(resources, ad.getDescription()));
answer.setCardinality(ad.getCardinality());
answer.setDefaultValue(ad.getDefaultValue());
answer.setOptionLabels(ad.getOptionLabels());
answer.setOptionValues(ad.getOptionValues());
answer.setRequired(ad.isRequired());
answer.setTypeName(typeName(ad.getType()));
return answer;
}
Aggregations