protected void fixValue(DataElement element, Object fixed)
{
assert(_options.getCoercionMode() != CoercionMode.OFF);
_hasFix = true;
DataElement parentElement = element.getParent();
if (parentElement == null)
{
_fixed = fixed;
}
else
{
Object parent = parentElement.getValue();
if (parent.getClass() == DataMap.class)
{
DataMap map = (DataMap) parent;
if (map.isReadOnly())
{
_hasFixupReadOnlyError = true;
addMessage(element, "cannot be fixed because DataMap backing %1$s type is read-only", parentElement.getSchema().getUnionMemberKey());
}
else
{
map.put((String) element.getName(), fixed);
}