}
protected JavaField newStateField() throws SAXException {
JavaField jf = getJavaSource().newJavaField("__state", boolean[].class, JavaSource.PRIVATE);
jf.addLine("new ", boolean.class, "[" + particles.length + "]");
JavaComment jc = jf.newComment();
jc.addLine("This array indicates the state of the group. For any");
jc.addLine("possible child, the corresponding boolean value is set,");
jc.addLine("if the child is parsed.");
jc.addLine("If the same child occurs again, and the childs boolean");
jc.addLine("value is true, then an exception is thrown.");
jc.addLine("These are the indices, to which the child elements are");
jc.addLine("mapped:");
for (int i = 0; i < particles.length; i++) {
ParticleSG particle = particles[i];
if (particle.isGroup()) {
GroupSG group = particle.getGroupSG();
if (group.isGlobal()) {
jc.addLine(" " + i + " = The nested group " + group.getName());
} else {
jc.addLine(" " + i + " = An anonymous nested group.");
}
} else if (particle.isElement()) {
jc.addLine(" " + i + " = The child element " + particle.getObjectSG().getName());
} else if (particle.isWildcard()) {
throw new IllegalStateException("TODO: Add support for wildcards.");
} else {
throw new IllegalStateException("Invalid particle type.");
}