private void writeEnumValueOfMethod(JEnumType type, JField mapField) {
// return Enum.valueOf(map, name);
SourceInfo sourceInfo = mapField.getSourceInfo().makeChild(
JavaASTGenerationVisitor.class, "enum accessor method");
JFieldRef mapRef = new JFieldRef(sourceInfo, null, mapField, type);
JVariableRef nameRef = createVariableRef(sourceInfo,
currentMethod.getParams().get(0));
JMethod delegateTo = program.getIndexedMethod("Enum.valueOf");
JMethodCall call = new JMethodCall(sourceInfo, null, delegateTo);
call.addArgs(mapRef, nameRef);