Package net.sf.wsdl2jibx.compiler

Examples of net.sf.wsdl2jibx.compiler.CompilerOptions


    if(fieldVisibility!=null) options.setFieldVisibility(fieldVisibility);
    options.setVerbose(verbose);
    createOutputDirectory();
    options.setOutDir(outputDirectory);
   
    CompilerOptions compilerOptions = options.getCompilerOptions();
    Compiler compiler = new Compiler(compilerOptions);
    compiler.execute();
  }
View Full Code Here


  public CompilerOptions getCompilerOptions() {
    return doCreateCompilerOptions();
  }
 
  protected CompilerOptions doCreateCompilerOptions() {
    CompilerOptions options = new CompilerOptions();
   
    if(outDir==null)
      throw new Wsdl2JibxException("Out directory must be specified");
    if(schemaFilesString==null)
      throw new Wsdl2JibxException("Schemas must be specified");
   
    StringTokenizer tokens = new StringTokenizer(schemaFilesString.trim(),",");
    this.schemaFilesList = new ArrayList();
    while(tokens.hasMoreTokens()) {
      String location = tokens.nextToken().trim();
      URL url;
      try {
        if(!location.startsWith("http") && !location.startsWith("file"))
          url = new URL("file:///"+new File(location).getAbsolutePath());
        else
          url = new URL(location);
      } catch(MalformedURLException ex) {
        throw new Wsdl2JibxException("Error in schema location ["+location+"]", ex);
      }
//      if(!file.)
//        throw new RuntimeException("File "+file.getAbsolutePath()+" does not exist");
      this.schemaFilesList.add(url);
    }
   
    if(fieldVisibility.equals("public"))
      options.setFieldVisibility(JavaSource.PUBLIC);
    else if(fieldVisibility.equals("protected"))
      options.setFieldVisibility(JavaSource.PROTECTED);
    else if(fieldVisibility.equals("private"))
      options.setFieldVisibility(JavaSource.PRIVATE);
    else if(fieldVisibility.equals("package"))
      options.setFieldVisibility(JavaSource.DEFAULT_PROTECTION);
   
    tokens = new StringTokenizer(accessors, ",");
    while(tokens.hasMoreTokens()) {
      String ac = tokens.nextToken();
      if("set".equals(ac))
        options.setHasSetter(true);
      else if("get".equals(ac))
        options.setHasGetter(true);
      else if("add".equals(ac))
        options.setHasAdder(true);
      else if("size".equals(ac))
        options.setHasSizer(true);
      else if("item".equals(ac))
        options.setHasItemer(true);
      else
        throw new RuntimeException("Accessor "+ac+" unknown");
    }
   
    options.setListAsPlainArray(this.plainArrays);
    options.setListInterface(this.listInterface);
    options.setListImplementation(this.listImplementation);
    options.setSerializable(this.serializable);
    if(this.licence!=null)
      options.setLicence(loadLicence());
    options.setBanner(loadBanner());
    options.setEncoding(this.encoding);
    options.setDisableJibx(this.disableJibx);
    options.setUnwrapArrays(this.unwrapArrays);
    options.setSchemaFiles(this.schemaFilesList);
    options.setUserPackage(this.userPackage);
    options.setSimpleDates(this.simpleDates);
   
    File outDirFile = new File(this.outDir);
    if(!outDirFile.exists())
      throw new RuntimeException("Directory "+outDir+" doest not exist");
    options.setOutDir(outDirFile);
   
    options.setKeepAbstract(this.keepAbstract);
    options.setForceClasses(this.forceClasses);
    options.setVerbose(this.debug);
   
    return options;
  }
View Full Code Here

    this.args = args;
    this.options = new ArgsOptions();
  }
 
  public void execute() {
    CompilerOptions compilerOptions = null;
    try {
      options.setParameters(args);
      compilerOptions = options.getCompilerOptions();
    } catch(Exception ex) {
      System.out.println(ex.toString());
      options.printUsage();
      return;
    }
   
    try {
      CommonsLoggingConfig.configure(compilerOptions.isVerbose());
      Compiler compiler = new Compiler(compilerOptions);
      compiler.execute();
     
    } catch(Exception ex) {
      ex.printStackTrace();
View Full Code Here

  public void setSimpleDates(boolean value) {
    options.setSimpleDates(value);
  }

  public void execute() throws BuildException {
    CompilerOptions compilerOptions = options.getCompilerOptions();
    CommonsLoggingConfig.configure(compilerOptions.isVerbose());
     
    Compiler compiler = new Compiler(compilerOptions);
    compiler.execute();
  }
View Full Code Here

TOP

Related Classes of net.sf.wsdl2jibx.compiler.CompilerOptions

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.