Exemple #1
0
 def doConstants(self):
     self.classfile.addField("serialVersionUID",
                             CodegenUtils.ci(java.lang.Long.TYPE), Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL)
     code = self.classfile.addMethod("<clinit>", ProxyCodeHelpers.makeSig("V"), Modifier.STATIC)
     code.visitLdcInsn(java.lang.Long(1))
     code.putstatic(self.classfile.name, "serialVersionUID", CodegenUtils.ci(java.lang.Long.TYPE))
     code.return_()
Exemple #2
0
 def doConstants(self):
     # FIXME eg, self.constants = { "fortytwo": (java.lang.Long(42), java.lang.Long.TYPE) }
     log.debug("Constants: %s", self.constants)
     code = self.classfile.addMethod("<clinit>", ProxyCodeHelpers.makeSig("V"), Modifier.STATIC)
     for constant, (value, constant_type) in sorted(self.constants.iteritems()):
         self.classfile.addField(
             constant,
             CodegenUtils.ci(constant_type), Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL)
         code.visitLdcInsn(value)
         code.putstatic(self.classfile.name, constant, CodegenUtils.ci(constant_type))
     code.return_()
Exemple #3
0
 def doConstants(self):
     self.classfile.addField(
         "serialVersionUID", CodegenUtils.ci(java.lang.Long.TYPE),
         Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL)
     code = self.classfile.addMethod("<clinit>",
                                     ProxyCodeHelpers.makeSig("V"),
                                     Modifier.STATIC)
     code.visitLdcInsn(java.lang.Long(1))
     code.putstatic(self.classfile.name, "serialVersionUID",
                    CodegenUtils.ci(java.lang.Long.TYPE))
     code.return_()
Exemple #4
0
 def doConstants(self):
     # FIXME eg, self.constants = { "fortytwo": (java.lang.Long(42), java.lang.Long.TYPE) }
     print "Constants", self.constants
     code = self.classfile.addMethod("<clinit>", ProxyCodeHelpers.makeSig("V"), Modifier.STATIC)
     for constant, (value, constant_type) in sorted(self.constants.iteritems()):
         self.classfile.addField(
             constant,
             CodegenUtils.ci(constant_type), Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL)
         code.visitLdcInsn(value)
         code.putstatic(self.classfile.name, constant, CodegenUtils.ci(constant_type))
     code.return_()