}
}
// Property
for (PropertyInfo propertyInfo : info.getProperties(Property.class)) {
Property propertyAnnotation = propertyInfo.getAnnotation(Property.class);
//
ValueInfo value;
if (propertyInfo instanceof SingleValuedPropertyInfo) {
SingleValuedPropertyInfo svp = (SingleValuedPropertyInfo)propertyInfo;
value = svp.getValue();
} else if (propertyInfo instanceof MultiValuedPropertyInfo) {
MultiValuedPropertyInfo mvp = (MultiValuedPropertyInfo)propertyInfo;
value = mvp.getElementValue();
} else {
throw new IllegalStateException();
}
//
if (value instanceof SimpleValueInfo) {
JCRPropertyMapping memberMapping = new JCRPropertyMapping(propertyAnnotation.name());
SimpleMapping<JCRPropertyMapping> simpleMapping = new SimpleMapping<JCRPropertyMapping>(memberMapping);
PropertyMapping<SimpleMapping<JCRPropertyMapping>> propertyMapping = new PropertyMapping<SimpleMapping<JCRPropertyMapping>>(propertyInfo, simpleMapping);
propertyMappings.add(propertyMapping);
} else {
throw new IllegalStateException("Cannot map property type " + value);