Exemplo n.º 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());
     }
   }
 }
Exemplo n.º 2
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()
             + "();");
   }
 }