instances.addLine(new Object[]{"new ", qNameArray, "{", instanceParams, "}"});
instances.setStatic(true);
instances.setFinal(true);
JavaConstructor con = js.newJavaConstructor(JavaSource.PRIVATE);
DirectAccessible pName = con.addParam(String.class, "pName");
DirectAccessible pValue = con.addParam(super.getRuntimeType(pController), "pValue");
DirectAccessible pLexicalValue = con.addParam(String.class, "pLexicalValue");
con.addLine(name, " = ", pName, ";");
con.addLine(value, " = ", pValue, ";");
con.addLine(lexicalValue, " = ", pLexicalValue, ";");
JavaMethod toStringMethod = js.newJavaMethod("toString", String.class, JavaSource.PUBLIC);
toStringMethod.addLine("return ", lexicalValue, ";");
JavaMethod getValueMethod = js.newJavaMethod("getValue", valueType, JavaSource.PUBLIC);
getValueMethod.addLine("return ", value, ";");
JavaMethod getNameMethod = js.newJavaMethod("getName", String.class, JavaSource.PUBLIC);
getNameMethod.addLine("return ", name, ";");
JavaMethod getInstancesMethod = js.newJavaMethod("getInstances", qNameArray, JavaSource.PUBLIC);
getInstancesMethod.setStatic(true);
getInstancesMethod.addLine("return ", instances, ";");
JavaMethod fromValueMethod = js.newJavaMethod("fromValue", qName, JavaSource.PUBLIC);
pValue = fromValueMethod.addParam(valueType, "pValue");
fromValueMethod.setStatic(true);
DirectAccessible i = fromValueMethod.addForArray(instances);
fromValueMethod.addIf(pController.getEqualsCheck(fromValueMethod, new Object[]{instances, "[", i, "].value"}, pValue));
fromValueMethod.addLine("return ", instances, "[", i, "];");
fromValueMethod.addEndIf();
fromValueMethod.addEndFor();
fromValueMethod.addThrowNew(IllegalArgumentException.class, JavaSource.getQuoted("Invalid value: "),