001package net.gdface.codegen.webclient; 002 003import org.apache.commons.cli.Options; 004 005import net.gdface.cli.Context; 006import net.gdface.codegen.generator.Generator; 007import net.gdface.codegen.generator.GeneratorConfiguration; 008import net.gdface.codegen.wsdl.ExtGeneratorUtils; 009 010/** 011 * @author guyadong 012 * 013 */ 014public class WebClientGenerator extends Generator { 015 public static void main(String[] args) { 016 new WebClientGenerator().parseCommandLine(args).initEngine().generate(); 017 } 018 019 private final WebClientOptions options = WebClientOptions.getInstance(); 020 021 protected WebClientConfiguration config = new WebClientConfiguration(); 022 023 public WebClientGenerator() { 024 } 025 026 @Override 027 protected GeneratorConfiguration getGeneratorConfiguration() { 028 return this.config; 029 } 030 031 @Override 032 protected Options getOptions() { 033 return options.getOptions(); 034 } 035 036 @Override 037 protected Context createEngineContext() { 038 Context context = super.createEngineContext(); 039 // 修改公共内置对象,使用ExtGeneratorUtils替换GeneratorUtils,以提供 isBase64Binary 方法 040 context.setProperty(GENERATOR_TOOL, ExtGeneratorUtils.class); 041 return context; 042 } 043 044}