private void applyDefaultsToObject(Cursor cursor, InnerCNode def) {
        for (CNode child : def.getChildren()) {
            Cursor childCursor = cursor.field(child.getName());
            if (isLeafNode(child) && canApplyDefault(childCursor, child)) {
                applyDefaultToLeaf(cursor, child);
            } else if (isInnerNode(child)) {
                if (!childCursor.valid()) {
                    if (child.isArray) {
                        childCursor = cursor.setArray(child.getName());
                    } else {
                        childCursor = cursor.setObject(child.getName());
                    }
                }
                applyDefaultsRecursive(childCursor, (InnerCNode) child);
            }
        }
    }
Applies default values of a given config definition to a slime payload.
TODO: Support giving correct type of default values

@author Ulf Lilleengen
config/src/main/java/com/yahoo/vespa/config/DefaultValueApplier.java