137138139140141142143144145146147
public String toCode() { return "count = i;"; } } ); mutator.addAnnotation(Tezt.class); mutator.addModifier(JavaModifier.PUBLIC); mutator.addModifier(JavaModifier.FINAL); javaClass.addMethod(mutator); PrintWriter printWriter = new PrintWriter(System.out);
147148149150151152153154155156157
new JavaMethod("restoreState", Void.TYPE, arg("context", FacesContext.class), arg("state", Object.class)); method.addModifier(JavaModifier.PUBLIC); method.addAnnotation(Override.class); return method; } private JavaMethod getSaveStateTemplate() {
158159160161162163164165166167168
JavaMethod method = new JavaMethod("saveState", Object.class, arg("context", FacesContext.class)); method.addModifier(JavaModifier.PUBLIC); method.addAnnotation(Override.class); method.setMethodBody(new MethodBody() { @Override public String toCode() { return "return super.saveState(context);"; }