public void function populate(required struct memento, boolean trustedSetter=false, string include="", string exclude="", string disallowConversionToNull=""){ var object = this; var key = ""; var populate = true; // Populate Bean for(key in memento){ populate = true; // Include List? if( len(include) AND NOT listFindNoCase(include,key) ){ populate = false; } // Exclude List? if( len(exclude) AND listFindNoCase(exclude,key) ){ populate = false; } // Populate? if( populate ){ // Check if the setter exists or if trusted setting is on if( structKeyExists(object,"set" & key) or trustedSetter ){ // If the value is blank it might be converted to null if( isSimpleValue(memento[key]) && trim(memento[key]) == "" ){ // Check if this value should be kept as a string instead of converted to null if( len(disallowConversionToNull) AND NOT listFindNoCase(disallowConversionToNull,key) ){ evaluate("object.set#key#(memento[key])"); } else { // Set the value to null evaluate('object.set#key#(javacast("null",""))'); } } else { evaluate("object.set#key#(memento[key])"); } } } } }