public void updateConfiguration()

in src/main/java/org/apache/sling/installer/factories/configuration/impl/MetatypeHandler.java [43:74]


    public void updateConfiguration(final String factoryPid,
            final String pid,
            final Dictionary<String, Object> props, 
            final Dictionary<String, Object> defaultProps) {
        // search metatype
        final ObjectClassDefinition ocd;
        if ( factoryPid != null ) {
            ocd = this.getObjectClassDefinition( factoryPid );
        } else {
            ocd = this.getObjectClassDefinition(  pid );
        }

        if ( ocd != null ) {
            for(final AttributeDefinition ad : ocd.getAttributeDefinitions(ObjectClassDefinition.ALL)) {
                final String propName = ad.getID();
                final Object newValue = props.get(propName);
                if ( newValue != null 
                        && (defaultProps == null || defaultProps.get(propName) == null) ) {
                    if ( ad.getCardinality() == 0 ) {
                        if ( !shouldSet(ad, newValue.toString())) {
                            props.remove(propName);                            
                        }
                    } else {
                        final String[] array = Converters.standardConverter().convert(newValue).to(String[].class);
                        if ( !shouldSet(ad, array)) {
                            props.remove(propName);
                        }                        
                    }        
                }
            }
        }
    }