/** * <b>INTERNAL</b>: Direct access to the value in the Object[] for this * mapping. This method is provided for advanced users and BYPASSES THE USE * OF NULL_VALUE. All application access should be done using the * {@link DynamicEntity} API */ public void setRawValue(Object entity, Object value) { getValues(entity)[getIndex()] = value; }
protected boolean isSet(Object entity) throws DescriptorException { Object[] values = getValues(entity); Object value = values[getIndex()]; return value != null || value == NULL_VALUE; }
/** * <b>INTERNAL</b>: Direct access to the value in the Object[] for this * mapping. This method is provided for advanced users and can provide * direct access to he NULL_VALUE. All application access should be done * using the {@link DynamicEntity} get/set API. */ public Object getRawValue(Object entity) { return getValues(entity)[getIndex()]; }
/** * Access the Object[] from the {@link DynamicEntity}. * <p> * If the length of the array is incorrect this is where it will be lazily * fixed. */ private Object[] getValues(Object entity) { Object[] values = ((DynamicEntityImpl) entity).values; if (getIndex() >= values.length) { Object[] newValues = new Object[getType().getNumberOfProperties()]; System.arraycopy(values, 0, newValues, 0, values.length); ((DynamicEntityImpl) entity).values = newValues; values = newValues; } return values; }