private GroupHandlerSG newGroupHandlerSG(ParticleSG pParticle, String pName) throws SAXException {
JavaSource js = getJavaSource();
JavaInnerClass jic = js.newJavaInnerClass(pName, JavaSource.PUBLIC);
jic.addExtends(JMSAXGroupParser.class);
GroupSG group = pParticle.getGroupSG();
if (group.isSequence()) {
return new SequenceHandlerSG(outerHandler, ctSG, pParticle, jic);
} else if (group.isChoice()) {
return new ChoiceHandlerSG(outerHandler, ctSG, pParticle, jic);
} else if (group.isAll()) {
return new AllHandlerSG(outerHandler, ctSG, pParticle, jic);
} else {
throw new IllegalStateException("Invalid group type");
}
}