protected void loadProperties()

in src/main/java/org/apache/sling/installer/provider/jcr/impl/ConfigNodeConverter.java [82:116]


    protected void loadProperties(Dictionary<String, Object> d, Node n) throws RepositoryException {
        final PropertyIterator pi = n.getProperties();
        while(pi.hasNext()) {
            final Property p = pi.nextProperty();
            final String name = p.getName();

            // ignore jcr: and similar properties
            if(name.contains(":")) {
                continue;
            }
            if (p.getDefinition().isMultiple()) {
                Object [] data = null;
                final Value [] values = p.getValues();
                int i = 0;
                for (Value v : values) {
                    Object o = convertValue(v);
                    if (data == null) {
                        data = (Object[])Array.newInstance(o.getClass(), values.length);
                    }
                    data[i++] = o;
                }
                // create empty array in case no value is specified
                if ( data == null ) {
                    data = new String[0];
                }
                d.put(name, data);

            } else {
                final Object o = convertValue(p.getValue());
                if (o != null) {
                    d.put(name, o);
                }
            }
        }
    }