JavaQName qNameArray = JavaQNameImpl.getArray(qName);
JavaSource js = pController.getSchema().getJavaSourceFactory().newJavaSource(qName, JavaSource.PUBLIC);
js.addImplements(Serializable.class);
JavaField name = js.newJavaField("name", String.class, JavaSource.PRIVATE);
name.setFinal(true);
JavaField value = js.newJavaField("value", valueType, JavaSource.PRIVATE);
value.setFinal(true);
JavaField lexicalValue = js.newJavaField("lexicalValue", String.class, JavaSource.PRIVATE);
lexicalValue.setFinal(true);
List instanceParams = new ArrayList();
for (int i = 0; i < values.length; i++) {
JavaField _f = js.newJavaField("_" + values[i].getName(), String.class, JavaSource.PUBLIC);
_f.setStatic(true);
_f.setFinal(true);
_f.addLine(JavaSource.getQuoted(values[i].getName()));
JavaField f = js.newJavaField(values[i].getName(), qName, JavaSource.PUBLIC);
f.addLine("new ", qName, "(", JavaSource.getQuoted(values[i].getName()), ", ",
super.getCastFromString(pController, values[i].getValue()), ", ",
JavaSource.getQuoted(values[i].getValue()), ");");
f.setStatic(true);
f.setFinal(true);
if (!instanceParams.isEmpty()) instanceParams.add(", ");
instanceParams.add(f);
}
JavaField instances = js.newJavaField("instances", qNameArray, JavaSource.PRIVATE);
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");