示例#1
0
 public void genCodeAttributeGetSet(BufferedWriter out) throws IOException {
   if (lifeline.getParameter() != null) {
     out.write(lifeline.getParameter());
   } else {
     if (lifeline.getRepresents() != null) {
       out.write(lifeline.getRepresents().getName());
     }
   }
 }
示例#2
0
 @Override
 public void codeGenerator(BufferedWriter out, int tab) throws IOException {
   for (Fragment order : lifeline.getOrder()) {
     generatorFragment = new FragmentAndroid(order);
     generatorFragment.codeGenerator(out, tab);
   }
 }
示例#3
0
 public void genCodeCreate(BufferedWriter out) throws IOException {
   if (lifeline.getName().contains("Intent")) {
     int n;
     n = lifeline.getName().indexOf(":");
     lifeline.setRepresents(new Attribute(lifeline.getName().substring(0, n - 1)));
     lifeline.getRepresents().setType(lifeline.getName().substring(n + 2));
     out.write(lifeline.getName().substring(n + 2) + " ");
     out.write(lifeline.getName().substring(0, n - 1) + " = new ");
     out.write(lifeline.getName().substring(n + 2) + "(");
     out.write(lifeline.getOrder().get(0).getMessage().getName());
     out.write(");");
   } else if (lifeline.getRepresents() != null) {
     out.write(
         lifeline.getRepresents().getName()
             + " = new "
             + lifeline.getRepresents().getType()
             + "();");
   }
 }