ClassDefinition classdef = new ClassDefinition(EXAMPLE_CODE_PACKAGE, EXAMPLE_CODE_CLASS);
classdef.setSuperClass(HttpServlet.class);
classdef.addImport(HttpServlet.class);
classdef.addImport(HttpServletRequest.class);
classdef.addImport(HttpServletResponse.class);
classdef.addImport(ServletException.class);
classdef.addImport(IOException.class);
MethodDefinition method = new MethodDefinition("service");
method.setPublic(true);
method.addThrowsClause(ServletException.class).addThrowsClause(IOException.class);
method.addArg(HttpServletRequest.class, "request");