visitBuildMethod()

in lib/generator.js [1002:1012]


  visitBuildMethod(ast, level) {
    var className = this.getSubFieldClassName(ast.modelName.lexeme);
    this.emit(`public static ${className} build(java.util.Map<String, ?> map)`, level);
    if (!this.NoException) {
      this.emit(` throws Exception`);
    }
    this.emit(` {\n`);
    this.emit(`${className} self = new ${className}();\n`, level + 1);
    this.emit('return TeaModel.build(map, self);\n', level + 1);
    this.emit(`}\n\n`, level);
  }