public JCRPropertyWrapper setProperty(String name, Value[] values) throws ValueFormatException, VersionException, LockException, ConstraintViolationException, RepositoryException {
checkLock();
hasPropertyCache.remove(name);
final Locale locale = getSession().getLocale();
name = ensurePrefixedName(name);
ExtendedPropertyDefinition epd = getApplicablePropertyDefinition(name);
if (epd == null) {
throw new ConstraintViolationException("Couldn't find definition for property " + name);
}
if (values != null) {
for (int i = 0; i < values.length; i++) {
if (values[i] != null && PropertyType.UNDEFINED != epd.getRequiredType() && values[i].getType() != epd.getRequiredType()) {
values[i] = getSession().getValueFactory()
.createValue(values[i].getString(), epd.getRequiredType());
}
}
}
values = JCRStoreService.getInstance().getInterceptorChain().beforeSetValues(this, name, epd, values);
if (locale != null) {
if (epd != null && epd.isInternationalized()) {
return new JCRPropertyWrapperImpl(this, getOrCreateI18N(locale).setProperty(name, values), session, provider, epd, name);
}
}
return new JCRPropertyWrapperImpl(this, objectNode.setProperty(name, values), session, provider, epd);