Examples of VelocityGenerator


Examples of cc.catalysts.cdoclet.generator.VelocityGenerator

    }

    if ("actionscript".equals(generator)) {
      return new AsGenerator(destination, namespace, enumAnnotation, typeMap, annotationTypeMap, annotationMap);
    } else if ("cs".equals(generator)) {
      return new VelocityGenerator(destination, namespace, "cs", enumAnnotation, typeMap, annotationTypeMap, annotationMap);
    }
    return null;
  }
View Full Code Here

Examples of org.apache.beehive.controls.runtime.generator.VelocityGenerator

        if (_generator == null) {
            /* Locate the class that wraps the Velocity code generation process */
            AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();

            try {
                _generator = new VelocityGenerator(env);
            }
            catch (Exception e) {
                throw new CodeGenerationException("Unable to create code generator", e);
            }
        }
View Full Code Here

Examples of org.apache.beehive.controls.runtime.generator.VelocityGenerator

        if (_generator == null) {
            /* Locate the class that wraps the Velocity code generation process */
            AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();

            try {
                _generator = new VelocityGenerator(env);
            }
            catch (Exception e) {
                throw new CodeGenerationException("Unable to create code generator", e);
            }
        }
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

        return dir;
    }

    public void generateAndCompile(Collection<JavaClass> wrapperClasses, File dir) {
        VelocityGenerator generator = new VelocityGenerator(false);
        generator.setBaseDir(dir.toString());

        List<File> generatedFiles = new ArrayList<File>();
        try {
            for (JavaClass wrapperClass : wrapperClasses) {
                generator.setCommonAttributes();
                generator.setAttributes("bean", wrapperClass);
           
                File file = generator.parseOutputName(wrapperClass.getPackageName(),
                                                      wrapperClass.getName());
                generatedFiles.add(file);
           
                generator.doWrite(TEMPLATE, FileWriterUtil.getWriter(file));
           
                generator.clearAttributes();
            }
       
                //compile the classes
            Compiler compiler = new Compiler();
            compiler.setOutputDir(compileToDir);
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

    public File generate(File outputdir) {
        Class<?> dateType = getDateType();
        File xjb = getJAXBCustFile(outputdir);

        if (dateType != null) {
            VelocityGenerator generator = new VelocityGenerator(false);

            generator.setCommonAttributes();
            generator.setAttributes("parseMethod", getAdapterMethod(dateType, ".parseDateTime"));
            generator.setAttributes("printMethod", getAdapterMethod(dateType, ".printDateTime"));
            generator.setAttributes("datetype", dateType.getName());

            if (allowImports()) {
                if (schemaFiles.size() == 0) {
                    return null;
                }
                generator.setAttributes("schemaFiles", schemaFiles);
            } else {
                generator.setAttributes("wsdlName", wsdlName);
                List<String> ns = getSchemaNamespaces();
                if (ns.size() == 0) {
                    return null;
                }
                generator.setAttributes("targetNamespaces", ns);
            }

            try {
                generator.doWrite(getTemplate(), FileWriterUtil.getWriter(xjb));
            } catch (Exception e) {
                e.printStackTrace();
            }

            generator.clearAttributes();
        }
        return xjb;
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

    public File generate(File outputdir) {
        Class<?> dateType = getDateType();
        File xjb = getJAXBCustFile(outputdir);

        if (dateType != null) {
            VelocityGenerator generator = new VelocityGenerator(false);

            generator.setCommonAttributes();
            generator.setAttributes("parseMethod", getAdapterMethod(dateType, ".parseDateTime"));
            generator.setAttributes("printMethod", getAdapterMethod(dateType, ".printDateTime"));
            generator.setAttributes("datetype", dateType.getName());

            if (allowImports()) {
                if (schemaFiles.size() == 0) {
                    return null;
                }
                generator.setAttributes("schemaFiles", schemaFiles);
            } else {
                generator.setAttributes("wsdlName", wsdlName);
                List<String> ns = getSchemaNamespaces();
                if (ns.size() == 0) {
                    return null;
                }
                generator.setAttributes("targetNamespaces", ns);
            }

            try {
                generator.doWrite(getTemplate(), FileWriterUtil.getWriter(xjb));
            } catch (Exception e) {
                e.printStackTrace();
            }

            generator.clearAttributes();
        }
        return xjb;
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

    public File generate(File outputdir) {
        Class dateType = getDateType();
        File xjb = getJAXBCustFile(outputdir);

        if (dateType != null) {
            VelocityGenerator generator = new VelocityGenerator();

            generator.setCommonAttributes();
            generator.setAttributes("parseMethod", getAdapterMethod(dateType, ".parseDateTime"));
            generator.setAttributes("printMethod", getAdapterMethod(dateType, ".printDateTime"));
            generator.setAttributes("datetype", dateType.getName());

            if (allowImports()) {
                if (schemaFiles.size() == 0) {
                    return null;
                }
                generator.setAttributes("schemaFiles", schemaFiles);
            } else {
                generator.setAttributes("wsdlName", wsdlName);
                List<String> ns = getSchemaNamespaces();
                if (ns.size() == 0) {
                    return null;
                }
                generator.setAttributes("targetNamespaces", ns);
            }

            try {
                generator.doWrite(getTemplate(), FileWriterUtil.getWriter(xjb));
            } catch (Exception e) {
                e.printStackTrace();
            }

            generator.clearAttributes();
        }
        return xjb;
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

        return dir;
    }

    public void generateAndCompile(Collection<JavaClass> wrapperClasses, File dir) {
        VelocityGenerator generator = new VelocityGenerator(false);
        generator.setBaseDir(dir.toString());

        List<File> generatedFiles = new ArrayList<File>();
        try {
            for (JavaClass wrapperClass : wrapperClasses) {
                generator.setCommonAttributes();
                generator.setAttributes("bean", wrapperClass);
           
                File file = generator.parseOutputName(wrapperClass.getPackageName(),
                                                      wrapperClass.getName());
                generatedFiles.add(file);
           
                generator.doWrite(TEMPLATE, FileWriterUtil.getWriter(file));
           
                generator.clearAttributes();
            }
       
                //compile the classes
            Compiler compiler = new Compiler();
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

        return dir;
    }

    public void generateAndCompile(Collection<JavaClass> wrapperClasses, File dir) {
        VelocityGenerator generator = new VelocityGenerator();
        generator.setBaseDir(dir.toString());

        List<File> generatedFiles = new ArrayList<File>();
        try {
            for (JavaClass wrapperClass : wrapperClasses) {
                generator.setCommonAttributes();
                generator.setAttributes("bean", wrapperClass);
           
                File file = generator.parseOutputName(wrapperClass.getPackageName(),
                                                      wrapperClass.getName());
                generatedFiles.add(file);
           
                generator.doWrite(TEMPLATE, FileWriterUtil.getWriter(file));
           
                generator.clearAttributes();
            }
       
                //compile the classes
            Compiler compiler = new Compiler();
View Full Code Here

Examples of org.apache.cxf.tools.common.VelocityGenerator

        }
        return packages;
    }

    private void generatePluginXML(List<File> jars) throws Exception {
        VelocityGenerator velocity = new VelocityGenerator(false);

        String templateFile = getTemplateFile(ECLIPSE_VERSION);

        velocity.setAttributes("ECLIPSE_VERSION", ECLIPSE_VERSION);
        velocity.setAttributes("PLUGIN_VERSION", getVersion());
        velocity.setAttributes("GROUP_ID", project.getGroupId());
        velocity.setAttributes("libPath", LIB_PATH);
        velocity.setAttributes("jars", jars);
       
        velocity.setAttributes("exportedPackages", getExportedPackages(jars));
        File outputFile = new File(targetDir, "MANIFEST.MF");

        velocity.doWrite(templateFile, FileWriterUtil.getWriter(outputFile));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.