Package com.sun.codemodel

Examples of com.sun.codemodel.JCodeModel$JReferencedClass


        generator.setBinding("jaxb");
        generator.setOverwrite(true);
       
        generator.generate();
       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("org.codehaus.xfire.test.echo.SendMessagePortType");
        assertNotNull(echo);
       
        File file = getTestFile("target/test-services/org/codehaus/xfire/test/echo/SendMessageImpl.java");
        assertTrue(file.exists());
        long lastModified = file.lastModified();
View Full Code Here


        generator.setBinding("jaxb");
        generator.setOverwrite(true);
       
        generator.generate();
       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("org.codehaus.xfire.generator.wsrp.WSRPServiceClient");
        assertNotNull(echo);
    }
View Full Code Here

        generator.setDestinationPackage("services.global");
        generator.setProfile(JAXWSProfile.class.getName());
       
        generator.generate();
       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("services.global.GlobalWeatherService");
        assertNotNull(echo);
    }
View Full Code Here

        generator.setDestinationPackage("services.headerout");
        generator.setProfile(JAXWSProfile.class.getName());
       
        generator.generate();
       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("services.headerout.EchoPortType");
        assertNotNull(echo);
    }
View Full Code Here

        generator.setDestinationPackage("services.echo");
        generator.setProfile(JAXWSProfile.class.getName());
       
        generator.generate();
       
        JCodeModel model = generator.getCodeModel();
        JDefinedClass echo = model._getClass("services.echo.EchoPortType");
        assertNotNull(echo);
    }
View Full Code Here

            return;
        }
        try {
            if (rawJaxbModelGenCode instanceof S2JJAXBModel) {
                S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;
                JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);
                String dir = (String)env.get(ToolConstants.CFG_OUTPUTDIR);
                FileCodeWriter fileCodeWriter = new FileCodeWriter(new File(dir));
                jcodeModel.build(fileCodeWriter);
            } else {
                return;
            }
        } catch (IOException e) {
            Message msg = new Message("FAIL_TO_GENERATE_TYPES", LOG);
View Full Code Here

                ClassCollector classCollector = context.get(ClassCollector.class);
                for (JClass cls : schem2JavaJaxbModel.getAllObjectFactories()) {
                    classCollector.getTypesPackages().add(cls._package().name());
                }

                JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);

                if (!isSuppressCodeGen()) {
                    jcodeModel.build(fileCodeWriter);
                }

                context.put(JCodeModel.class, jcodeModel);

                for (String str : fileCodeWriter.getExcludeFileList()) {
View Full Code Here

        compiler.setClassNameAllocator(allocator);

        addSchemas(wsdlUrl, schemas, compiler);
        addBindingFiles(bindingFiles, compiler);
        S2JJAXBModel intermediateModel = compiler.bind();
        JCodeModel codeModel = intermediateModel.generateCode(null, elForRun);
        StringBuilder sb = new StringBuilder();
        boolean firstnt = false;

        for (Iterator<JPackage> packages = codeModel.packages(); packages.hasNext();) {
            JPackage jpackage = packages.next();
            if (!isValidPackage(jpackage)) {
                continue;
            }
            if (firstnt) {
                sb.append(':');
            } else {
                firstnt = true;
            }
            sb.append(jpackage.name());
        }
        outputDebug(codeModel);
       
        String packageList = sb.toString();

        // our hashcode + timestamp ought to be enough.
        String stem = toString() + "-" + System.currentTimeMillis();
        File src = new File(tmpdir, stem + "-src");
        if (!src.mkdir()) {
            throw new IllegalStateException("Unable to create working directory " + src.getPath());
        }
        try {
            FileCodeWriter writer = new FileCodeWriter(src);
            codeModel.build(writer);
        } catch (IOException e) {
            throw new IllegalStateException("Unable to write generated Java files for schemas: "
                                            + e.getMessage(), e);
        }
        File classes = new File(tmpdir, stem + "-classes");
View Full Code Here

            ClassCollector classCollector = context.get(ClassCollector.class);
            for (JClass cls : schem2JavaJaxbModel.getAllObjectFactories()) {
                classCollector.getTypesPackages().add(cls._package().name());
            }

            JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);

            if (!isSuppressCodeGen()) {
                jcodeModel.build(fileCodeWriter);
            }

            context.put(JCodeModel.class, jcodeModel);

            for (String str : fileCodeWriter.getExcludeFileList()) {
View Full Code Here

            TypesCodeWriter fileCodeWriter = new TypesCodeWriter(new File(dir), context.getExcludePkgList());

            if (rawJaxbModelGenCode instanceof S2JJAXBModel) {
                S2JJAXBModel schem2JavaJaxbModel = (S2JJAXBModel)rawJaxbModelGenCode;
                JCodeModel jcodeModel = schem2JavaJaxbModel.generateCode(null, null);

                if (!isSuppressCodeGen()) {
                    jcodeModel.build(fileCodeWriter);
                }

                context.put(JCodeModel.class, jcodeModel);
                for (String str : fileCodeWriter.getExcludeFileList()) {
                    context.getExcludeFileList().add(str);
View Full Code Here

TOP

Related Classes of com.sun.codemodel.JCodeModel$JReferencedClass

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.