JBlock (JDefinedClass pojo) { final JDefinedClass deserializer; try { deserializer = pojo._class(JMod.STATIC | JMod.PUBLIC, "MyDeserializer"); } catch (JClassAlreadyExistsException e) { throw new GenerationException(e); } deserializer._extends(pojo.owner().ref(JsonDeserializer.class).narrow(pojo)); JAnnotationUse annotation = pojo.annotate(JsonDeserialize.class); annotation.param("using", deserializer); JMethod deserialize = deserializer.method(JMod.PUBLIC, pojo, "deserialize"); deserialize.annotate(Override.class); deserialize.param(JsonParser.class, "parser"); deserialize.param(DeserializationContext.class, "deserializationContext"); deserialize._throws(IOException.class); return deserialize.body(); }