public ValueImpl(ValueDescriptorImpl<?> descriptor) { this.descriptor = descriptor; this.values = new Object[descriptor.getSize()]; Collection<PropertyImpl> properties = descriptor.internalGetProperties(); for (PropertyImpl property : properties) { values[property.getIndex()] = property.getInitializer().init(); } }
@Override public Object handlePropertyAccess(Object self, ValueImpl impl, Object... args) { PropertyImpl property = (PropertyImpl) args[0]; Object value = args[1]; if (value == null) { value = property.getInitializer().init(); } return property.getSetHandler().handlePropertyAccess(self, impl, value); }