}
ClassWriter cw = helper.createClassWriter();
FieldVisitor fv;
MethodVisitor mv;
AnnotationVisitor av0;
cw.visit(Opcodes.V1_6, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER + Opcodes.ACC_SYNTHETIC,
className + "Extensibility", null,
className,
new String[] {"javax/wsdl/extensions/ExtensibilityElement"});
cw.visitSource(cls.getSimpleName() + "Extensibility.java", null);
fv = cw.visitField(Opcodes.ACC_PRIVATE + Opcodes.ACC_FINAL + Opcodes.ACC_STATIC,
"WSDL_REQUIRED", "Ljavax/xml/namespace/QName;", null, null);
fv.visitEnd();
fv = cw.visitField(0, "qn", "Ljavax/xml/namespace/QName;", null, null);
fv.visitEnd();
boolean hasAttributes = false;
try {
Method m = cls.getDeclaredMethod("getOtherAttributes");
if (m != null && m.getReturnType() == Map.class){
hasAttributes = true;
}
} catch (Throwable t) {
//ignore
}
if (hasAttributes) {
mv = cw.visitMethod(Opcodes.ACC_STATIC, "<clinit>", "()V", null, null);
mv.visitCode();
Label l0 = helper.createLabel();
mv.visitLabel(l0);
mv.visitLineNumber(64, l0);
mv.visitTypeInsn(Opcodes.NEW, "javax/xml/namespace/QName");
mv.visitInsn(Opcodes.DUP);
mv.visitLdcInsn("http://schemas.xmlsoap.org/wsdl/");
mv.visitLdcInsn("required");
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName", "<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
mv.visitFieldInsn(Opcodes.PUTSTATIC, className + "Extensibility", "WSDL_REQUIRED", "Ljavax/xml/namespace/QName;");
mv.visitInsn(Opcodes.RETURN);
mv.visitMaxs(4, 0);
mv.visitEnd();
} else {
fv = cw.visitField(Opcodes.ACC_PRIVATE, "required", "Ljava/lang/Boolean;", null, null);
fv.visitEnd();
}
mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
Label l0 = helper.createLabel();
mv.visitLabel(l0);
mv.visitLineNumber(33, l0);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, className, "<init>", "()V", false);
Label l1 = helper.createLabel();
mv.visitLabel(l1);
mv.visitLineNumber(31, l1);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitTypeInsn(Opcodes.NEW, "javax/xml/namespace/QName");
mv.visitInsn(Opcodes.DUP);
mv.visitLdcInsn(qname.getNamespaceURI());
mv.visitLdcInsn(qname.getLocalPart());
mv.visitMethodInsn(Opcodes.INVOKESPECIAL, "javax/xml/namespace/QName",
"<init>", "(Ljava/lang/String;Ljava/lang/String;)V", false);
mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility",
"qn", "Ljavax/xml/namespace/QName;");
Label l2 = helper.createLabel();
mv.visitLabel(l2);
mv.visitLineNumber(34, l2);
mv.visitInsn(Opcodes.RETURN);
Label l3 = helper.createLabel();
mv.visitLabel(l3);
mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l3, 0);
mv.visitMaxs(5, 1);
mv.visitEnd();
mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "setElementType", "(Ljavax/xml/namespace/QName;)V", null, null);
mv.visitCode();
l0 = helper.createLabel();
mv.visitLabel(l0);
mv.visitLineNumber(37, l0);
mv.visitVarInsn(Opcodes.ALOAD, 0);
mv.visitVarInsn(Opcodes.ALOAD, 1);
mv.visitFieldInsn(Opcodes.PUTFIELD, className + "Extensibility", "qn", "Ljavax/xml/namespace/QName;");
l1 = helper.createLabel();
mv.visitLabel(l1);
mv.visitLineNumber(38, l1);
mv.visitInsn(Opcodes.RETURN);
l2 = helper.createLabel();
mv.visitLabel(l2);
mv.visitLocalVariable("this", "L" + className + "Extensibility;", null, l0, l2, 0);
mv.visitLocalVariable("elementType", "Ljavax/xml/namespace/QName;", null, l0, l2, 1);
mv.visitMaxs(2, 2);
mv.visitEnd();
mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "getElementType", "()Ljavax/xml/namespace/QName;", null, null);
av0 = mv.visitAnnotation("Ljavax/xml/bind/annotation/XmlTransient;", true);
av0.visitEnd();
mv.visitCode();
l0 = helper.createLabel();
mv.visitLabel(l0);
mv.visitLineNumber(40, l0);
mv.visitVarInsn(Opcodes.ALOAD, 0);