protected Set<Name> getMultiValuedProperties(Property multiValuedProperty) { // Go through the properties and see which properties are multi-valued ... Set<Name> multiValued = new HashSet<Name>(); for (Object value : multiValuedProperty) { Name multiValuedPropertyName = nameFactory.create(value); if (multiValuedPropertyName != null) { multiValued.add(multiValuedPropertyName); } } return multiValued; }
/** * Get the graph {@link Property property} for the supplied JCR property representation. * * @param jcrProperty the JCR property; may not be null * @return the graph property * @throws RepositoryException if there is an error working with the session */ public Property propertyFor(javax.jcr.Property jcrProperty) throws RepositoryException { // Get the values ... Object[] values = null; if (jcrProperty.getDefinition().isMultiple()) { Value[] jcrValues = jcrProperty.getValues(); values = new Object[jcrValues.length]; for (int i = 0; i < jcrValues.length; i++) { values[i] = convert(jcrValues[i], jcrProperty); } } else { values = new Object[] {convert(jcrProperty.getValue(), jcrProperty)}; } // Get the name, and then create the property ... Name name = nameFactory.create(jcrProperty.getName()); return propertyFactory.create(name, values); }