@Override final 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 = MethodUtil.invoke(getters[i], value, (Object[]) null); values[i] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }
/** * Converts to open value */ final 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); }
@Override final 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] = getterMappings[i].toOpenValue(got); } catch (Exception e) { throw openDataException("Error calling getter for " + itemNames[i] + ": " + e, e); } } return new CompositeDataSupport(ct, itemNames, values); }