public void state(JFormatter f) {
   if (JOp.hasTopOp(test)) {
     f.p("switch ").g(test).p(" {").nl();
   } else {
     f.p("switch (").g(test).p(')').p(" {").nl();
   }
   for (JCase c : cases) f.s(c);
   if (defaultCase != null) f.s(defaultCase);
   f.p('}').nl();
 }
Beispiel #2
0
 public void state(JFormatter f) {
   f.i();
   if (!isDefaultCase) {
     f.p("case ").g(label).p(':').nl();
   } else {
     f.p("default:").nl();
   }
   if (body != null) f.s(body);
   f.o();
 }