if (property != null && property.getDefinition().isProtected()) {
continue;
}
ValueFactory valueFactory = session.getValueFactory();
Value value = null;
Value[] values = null;
if (propertyValue instanceof String) {
value = valueFactory.createValue((String) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.STRING, false);
} else if (propertyValue instanceof String[]) {
values = toValueArray((String[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.STRING, true);
} else if (propertyValue instanceof Boolean) {
value = valueFactory.createValue((Boolean) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.BOOLEAN, false);
} else if (propertyValue instanceof Boolean[]) {
values = toValueArray((Boolean[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.BOOLEAN, true);
} else if (propertyValue instanceof Calendar) {
value = valueFactory.createValue((Calendar) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.DATE, false);
} else if (propertyValue instanceof Calendar[]) {
values = toValueArray((Calendar[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.DATE, true);
} else if (propertyValue instanceof Double) {
value = valueFactory.createValue((Double) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.DOUBLE, false);
} else if (propertyValue instanceof Double[]) {
values = toValueArray((Double[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.DOUBLE, true);
} else if (propertyValue instanceof BigDecimal) {
value = valueFactory.createValue((BigDecimal) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.DECIMAL, false);
} else if (propertyValue instanceof BigDecimal[]) {
values = toValueArray((BigDecimal[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.DECIMAL, true);
} else if (propertyValue instanceof Long) {
value = valueFactory.createValue((Long) propertyValue);
ensurePropertyDefinitionMatchers(property, PropertyType.LONG, false);
} else if (propertyValue instanceof Long[]) {
values = toValueArray((Long[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.LONG, true);
// TODO - distinguish between weak vs strong references
} else if (propertyValue instanceof UUID) {
Node reference = session.getNodeByIdentifier(((UUID) propertyValue).toString());
value = valueFactory.createValue(reference);
ensurePropertyDefinitionMatchers(property, PropertyType.REFERENCE, false);
} else if (propertyValue instanceof UUID[]) {
values = toValueArray((UUID[]) propertyValue, session);
ensurePropertyDefinitionMatchers(property, PropertyType.REFERENCE, true);
} else {