コード例 #1
0
 private List<TypeBodyDeclaration> createMembers() throws IOException {
   List<TypeBodyDeclaration> results = new ArrayList<>();
   results.addAll(driver.getFields(context, model));
   results.addAll(createPropertyAccessors());
   results.addAll(driver.getMethods(context, model));
   return results;
 }
コード例 #2
0
 /**
  * Emits the projective model.
  *
  * @throws IOException if failed to emit a source program
  */
 public void emit() throws IOException {
   driver.generateResources(context, model);
   context.emit(
       f.newInterfaceDeclaration(
           new JavadocBuilder(f)
               .text(
                   Messages.getString("ProjectiveModelEmitter.javadocClass"), // $NON-NLS-1$
                   context.getDescription(model))
               .toJavadoc(),
           createModifiers(),
           context.getTypeName(),
           driver.getInterfaces(context, model),
           createMembers()));
 }
コード例 #3
0
 private MethodDeclaration createOptionGetter(PropertyDeclaration property) throws IOException {
   assert property != null;
   return f.newMethodDeclaration(
       new JavadocBuilder(f)
           .text(
               Messages.getString("ProjectiveModelEmitter.javadocOptionGetter"), // $NON-NLS-1$
               context.getDescription(property))
           .returns()
           .text(context.getDescription(property))
           .toJavadoc(),
       driver.getMemberAnnotations(context, property),
       Collections.emptyList(),
       context.getFieldType(property),
       context.getOptionGetterName(property),
       Collections.emptyList(),
       0,
       Collections.emptyList(),
       null);
 }
コード例 #4
0
 private List<Attribute> createModifiers() throws IOException {
   List<Attribute> results = new ArrayList<>();
   results.addAll(driver.getTypeAnnotations(context, model));
   results.addAll(new AttributeBuilder(f).Public().toAttributes());
   return results;
 }