// setting a property to null is equivalent of removing it
return canRemoveItem(propertyName);
}
try {
Name name = resolver().getQName(propertyName);
QPropertyDefinition def;
try {
// try to get definition that matches the given value type
def = getApplicablePropDef(name, value.getType(), false);
} catch (ConstraintViolationException cve) {
// fallback: ignore type
def = getApplicablePropDef(name, PropertyType.UNDEFINED, false);
}
if (def.isProtected()) {
return false;
}
if (def.isMultiple()) {
return false;
}
Value v;
if (def.getRequiredType() != PropertyType.UNDEFINED
&& def.getRequiredType() != value.getType()) {
// type conversion required
v = ValueHelper.convert(value, def.getRequiredType(), valueFactory());
} else {
// no type conversion required
v = value;
}
// create QValue from Value