Package net.jangaroo.jooc.model

Examples of net.jangaroo.jooc.model.AnnotationPropertyModel


  private static void addEvents(CompilationUnitModel compilationUnitModel, List<Event> events) {
    for (Event event : events) {
      ClassModel classModel = compilationUnitModel.getClassModel();
      String eventTypeQName = generateEventClass(compilationUnitModel, event);
      AnnotationModel annotationModel = new AnnotationModel("Event",
              new AnnotationPropertyModel("name", "'" + event.name + "'"),
              new AnnotationPropertyModel("type", "'" + eventTypeQName + "'"));
      annotationModel.setAsdoc(toAsDoc(event.doc) + String.format("\n * @eventType %s.NAME", eventTypeQName));
      classModel.addAnnotation(annotationModel);
      System.err.println("*** adding event " + event.name + " to class " + classModel.getName());
    }
  }
View Full Code Here


    ((TypedModel)modelStack.peek()).setType(consumeRecordedCode());
  }

  @Override
  public void visitAnnotationParameter(AnnotationParameter annotationParameter) throws IOException {
    AnnotationPropertyModel annotationPropertyModel = new AnnotationPropertyModel();
    modelStack.push(annotationPropertyModel);
    visitIfNotNull(annotationParameter.getOptName());
    startRecordingCode();
    visitIfNotNull(annotationParameter.getValue());
    annotationPropertyModel.setValue(consumeRecordedCode());
    modelStack.pop();
    ((AnnotationModel)modelStack.peek()).addProperty(annotationPropertyModel);
  }
View Full Code Here

    // TODO: move to unit test!
    ClassModel classModel = new ClassModel("com.acme.Foo");
    classModel.setAsdoc("This is the Foo class.");

    AnnotationModel annotation = new AnnotationModel("ExtConfig",
      new AnnotationPropertyModel("target", "'foo.Bar'"));
    classModel.addAnnotation(annotation);

    FieldModel field = new FieldModel("FOOBAR");
    field.setType("String");
    field.setConst(true);
View Full Code Here

TOP

Related Classes of net.jangaroo.jooc.model.AnnotationPropertyModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.