io.vertx.codegen.Model Java Examples

The following examples show how to use io.vertx.codegen.Model. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebApiProxyModelProvider.java    From vertx-web with Apache License 2.0 5 votes vote down vote up
@Override
public Model getModel(ProcessingEnvironment env, TypeMirrorFactory typeFactory, TypeElement elt) {
  if (elt.getAnnotation(WebApiServiceGen.class) != null) {
    WebApiProxyModel model = new WebApiProxyModel(env, typeFactory, elt);
    return model;
  } else {
    return null;
  }
}
 
Example #2
Source File: TestGenerator.java    From vertx-codegen with Apache License 2.0 5 votes vote down vote up
@Override
public String render(Model model, int index, int size, Map<String, Object> session) {
  if (model instanceof ClassModel) {
    return ((ClassModel)model).getType().getSimpleName() + "\n";
  } else if (model instanceof DataObjectModel) {
    return ((DataObjectModel)model).getType().getSimpleName() + "\n";
  } else {
    throw new UnsupportedOperationException();
  }
}
 
Example #3
Source File: ProxyModelProvider.java    From vertx-service-proxy with Apache License 2.0 5 votes vote down vote up
@Override
public Model getModel(ProcessingEnvironment env, TypeMirrorFactory typeFactory, TypeElement elt) {
  if (elt.getAnnotation(ProxyGen.class) != null) {
    ProxyModel model = new ProxyModel(env, typeFactory, elt);
    return model;
  } else {
    return null;
  }
}
 
Example #4
Source File: TestGenerator.java    From vertx-codegen with Apache License 2.0 4 votes vote down vote up
@Override
public String filename(Model model) {
  return "resource/result.txt";
}
 
Example #5
Source File: TestGenerator.java    From vertx-codegen with Apache License 2.0 4 votes vote down vote up
@Override
public String filename(Model model) {
  return model.getFqn().replace('.', '_') + ".properties";
}
 
Example #6
Source File: TestGenerator.java    From vertx-codegen with Apache License 2.0 4 votes vote down vote up
@Override
public String render(Model model, int index, int size, Map<String, Object> session) {
  Map<String, Object> vars = model.getVars();
  return format(vars);
}