} catch (JClassAlreadyExistsException e) {
throw new BuildException(e);
}
// INSTANCE variable
JFieldVar instanceVar = jaxbEnumClass.field(JMod.PUBLIC | JMod.STATIC | JMod.FINAL, jaxbEnumClass, "INSTANCE", JExpr._new(jaxbEnumClass));
// constructor
JMethod constructor = jaxbEnumClass.constructor(JMod.PUBLIC);
constructor.body().invoke("super")
.arg(JExpr.dotclass(builderContext.toJClass(type)))
.arg(newQName(xmlRootElement))
.arg(newQName(xmlType));
// static parse
JMethod staticParse = jaxbEnumClass.method(JMod.PUBLIC | JMod.STATIC, type, "parse" + type.getSimpleName())._throws(Exception.class);
JVar xsrVar = staticParse.param(XoXMLStreamReader.class, "reader");
JVar contextVar = staticParse.param(builderContext.toJClass(RuntimeContext.class), "context");
JVar value = staticParse.param(String.class, "value");
staticParse.body()._return(instanceVar.invoke("parse").arg(xsrVar).arg(contextVar).arg(value));
// static toString
JMethod staticToString = jaxbEnumClass.method(JMod.PUBLIC | JMod.STATIC, String.class, "toString" + type.getSimpleName())._throws(Exception.class);
JVar beanVar = staticToString.param(Object.class, "bean");
JVar parameterNameVar = staticToString.param(String.class, "parameterName");
contextVar = staticToString.param(builderContext.toJClass(RuntimeContext.class), "context");
value = staticToString.param(type, decapitalize(type.getSimpleName()));
staticToString.body()._return(instanceVar.invoke("toString").arg(beanVar).arg(parameterNameVar).arg(contextVar).arg(value));
// instance parse
parseMethod = jaxbEnumClass.method(JMod.PUBLIC, type, "parse")._throws(Exception.class);
parseXSR = parseMethod.param(XoXMLStreamReader.class, "reader");
parseContext = parseMethod.param(builderContext.toJClass(RuntimeContext.class), "context");