use of javax.management.openmbean.CompositeDataView in project geode by apache.
the class CompositeConverter method toNonNullOpenValue.
/**
* Converts to open value
*/
Object toNonNullOpenValue(Object value) throws OpenDataException {
CompositeType ct = (CompositeType) getOpenType();
if (value instanceof CompositeDataView)
return ((CompositeDataView) value).toCompositeData(ct);
if (value == null)
return null;
Object[] values = new Object[getters.length];
for (int i = 0; i < getters.length; i++) {
try {
Object got = getters[i].invoke(value, (Object[]) null);
values[i] = getterConverters[i].toOpenValue(got);
} catch (Exception e) {
throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e);
}
}
return new CompositeDataSupport(ct, itemNames, values);
}
Aggregations