}
}
private void genPropProviders(PrintWriter pw) {
for (Iterator iter = moduleProps.iterator(); iter.hasNext();) {
Property prop = (Property) iter.next();
String activeValue = prop.getActiveValue();
if (activeValue == null) {
// Emit a provider function, defined by the user in module config.
PropertyProvider provider = prop.getProvider();
assert (provider != null) : "expecting a default property provider to have been set";
String js = provider.getBody().toSource();
pw.print("providers['" + prop.getName() + "'] = function() ");
pw.print(js);
pw.println(";");
// Emit a map of allowed property values as an object literal.
pw.println();
pw.println("values['" + prop.getName() + "'] = {");
String[] knownValues = prop.getKnownValues();
for (int i = 0; i < knownValues.length; i++) {
if (i > 0) {
pw.println(", ");
}
// Each entry is of the form: "propName":<index>.