Package com.sun.codemodel

Examples of com.sun.codemodel.CodeWriter


          }
        }
      }
    }

    codeModel.build(new CodeWriter() {
      @Override
      public Writer openSource(JPackage pkg, String fileName) throws IOException {
        File pkgDir = new File(sourcesDir, pkg.name().replace('.', '/'));
        pkgDir.mkdirs();
View Full Code Here


                // fatal error. error should have been reported
                return false;
            }
        }

        CodeWriter cw;
        if (options.filer != null) {
            cw = new FilerCodeWriter(options.sourceDir, options);
        } else {
            cw = new WSCodeWriter(options.sourceDir, options);
        }
View Full Code Here

                    if( opt.mode == Mode.DRYRUN )
                        break// enough

                    // then print them out
                    try {
                        CodeWriter cw;
                        if( opt.mode==Mode.ZIP ) {
                            OutputStream os;
                            if(opt.targetDir.getPath().equals("."))
                                os = System.out;
                            else
View Full Code Here

                mapper.generate(codeModel, getNodeName(source), defaultString(config.getTargetPackage()), source.toURI().toURL());
            }
        }

        if (config.getTargetDirectory().exists() || config.getTargetDirectory().mkdirs()) {
            CodeWriter sourcesWriter = new FileCodeWriterWithEncoding(config.getTargetDirectory(), config.getOutputEncoding());
            CodeWriter resourcesWriter = new FileCodeWriterWithEncoding(config.getTargetDirectory(), config.getOutputEncoding());
            codeModel.build(sourcesWriter, resourcesWriter);
        } else {
            throw new GenerationException("Could not create or access target directory " + config.getTargetDirectory().getAbsolutePath());
        }
    }
View Full Code Here

                SeiGenerator.generate(wsdlModel, options, receiver, genExtn);
                if(receiver.hadError()){
                    throw new AbortException();
                }
                ServiceGenerator.generate(wsdlModel, options, receiver);
                CodeWriter cw = new WSCodeWriter(options.sourceDir, options);
                if (options.verbose)
                    cw = new ProgressCodeWriter(cw, out);
                options.getCodeModel().build(cw);
            } catch(AbortException e){
                //error might have been reported
View Full Code Here

                    if( opt.mode == Mode.DRYRUN )
                        break// enough

                    // then print them out
                    try {
                        CodeWriter cw;
                        if( opt.mode==Mode.ZIP ) {
                            OutputStream os;
                            if(opt.targetDir.getPath().equals("."))
                                os = System.out;
                            else
View Full Code Here

                    if( opt.mode == Mode.DRYRUN )
                        break// enough

                    // then print them out
                    try {
                        CodeWriter cw;
                        if( opt.mode==Mode.ZIP ) {
                            OutputStream os;
                            if(opt.targetDir.getPath().equals("."))
                                os = System.out;
                            else
View Full Code Here

                SeiGenerator.generate(wsdlModel, options, receiver, genExtn);
                if(receiver.hadError()){
                    throw new AbortException();
                }
                ServiceGenerator.generate(wsdlModel, options, receiver);
                CodeWriter cw = new WSCodeWriter(options.sourceDir, options);
                if (options.verbose)
                    cw = new ProgressCodeWriter(cw, out);
                options.getCodeModel().build(cw);
            } catch(AbortException e){
                //error might have been reported
View Full Code Here

                    if( opt.mode == Mode.DRYRUN )
                        break// enough

                    // then print them out
                    try {
                        CodeWriter cw;
                        if( opt.mode==Mode.ZIP ) {
                            OutputStream os;
                            if(opt.targetDir.getPath().equals("."))
                                os = System.out;
                            else
View Full Code Here

                // fatal error. error should have been reported
                return false;
            }
        }

        CodeWriter cw;
        if (options.filer != null) {
            cw = new FilerCodeWriter(options.sourceDir, options);
        } else {
            cw = new WSCodeWriter(options.sourceDir, options);
        }
View Full Code Here

TOP

Related Classes of com.sun.codemodel.CodeWriter

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.