Package org.apache.cxf.tools.common

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


        List<FrontEndGenerator> generators = profile.getGenerators();
        assertNotNull(generators);
        assertEquals(2, generators.size());
        assertTrue(generators.get(0) instanceof AntGenerator);
        assertTrue(generators.get(1) instanceof ImplGenerator);
        Processor processor = profile.getProcessor();
        assertNotNull(processor);
        assertTrue(processor instanceof WSDLToJavaProcessor);

        AbstractWSDLBuilder builder = profile.getWSDLBuilder();
        assertNotNull(builder);
View Full Code Here


        context.put(ToolConstants.XML_SCHEMA_COLLECTION, schemaCollection);
       
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
       
        context.put(ClassCollector.class, createClassCollector());
        Processor processor = frontend.getProcessor();
        if (processor instanceof ClassNameProcessor) {
            processor.setEnvironment(context);
            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                ((ClassNameProcessor)processor).processClassNames();

                context.put(ServiceInfo.class, null);
            }
        }
       
        if (context.optionSet(ToolConstants.CFG_NO_TYPES)) {
            context.remove(ToolConstants.CFG_TYPES);
            context.remove(ToolConstants.CFG_ALL);
            context.remove(ToolConstants.CFG_COMPILE);
        }
       
        generateTypes();
        if (context.getErrorListener().getErrorCount() > 0) {
            return;
        }

        for (ServiceInfo service : serviceList) {
            context.put(ServiceInfo.class, service);

            if (context.basicValidateWSDL()) {
                validate(service);
            }

            if (context.getErrorListener().getErrorCount() == 0) {
                // Build the JavaModel from the ServiceModel
                processor.setEnvironment(context);
                processor.process();
            }
        }
        if (context.getErrorListener().getErrorCount() > 0) {
            return;
        }
View Full Code Here

        SchemaCollection schemaCollection = service0.getXmlSchemaCollection();
        context.put(ToolConstants.XML_SCHEMA_COLLECTION, schemaCollection);
       
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
        context.put(ClassCollector.class, new ClassCollector());
        Processor processor = frontend.getProcessor();
        if (processor instanceof ClassNameProcessor) {
            processor.setEnvironment(context);
            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                ((ClassNameProcessor)processor).processClassNames();

                context.put(ServiceInfo.class, null);
            }
        }
        generateTypes();

        for (ServiceInfo service : serviceList) {

            context.put(ServiceInfo.class, service);

            validate(service);

            // Build the JavaModel from the ServiceModel
            processor.setEnvironment(context);
            processor.process();

            if (!isSuppressCodeGen()) {
                // Generate artifacts
                for (FrontEndGenerator generator : frontend.getGenerators()) {
                    generator.generate(context);
View Full Code Here

            }
           
            context.put(ToolConstants.SCHEMA_MAP, schemas);
            context.put(ToolConstants.PORTTYPE_MAP, interfaces);
            context.put(ClassCollector.class, new ClassCollector());
            Processor processor = frontend.getProcessor();
            if (processor instanceof ClassNameProcessor) {
                processor.setEnvironment(context);
                for (ServiceInfo service : serviceList) {

                    context.put(ServiceInfo.class, service);

                    ((ClassNameProcessor)processor).processClassNames();

                    context.put(ServiceInfo.class, null);
                }
            }
            generateTypes();

            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                validate(service);

                // Build the JavaModel from the ServiceModel
                processor.setEnvironment(context);
                processor.process();

                if (!isSuppressCodeGen()) {
                    // Generate artifacts
                    for (FrontEndGenerator generator : frontend.getGenerators()) {
                        generator.generate(context);
View Full Code Here

        SchemaCollection schemaCollection = service0.getXmlSchemaCollection();
        context.put(ToolConstants.XML_SCHEMA_COLLECTION, schemaCollection);
       
        context.put(ToolConstants.PORTTYPE_MAP, interfaces);
        context.put(ClassCollector.class, new ClassCollector());
        Processor processor = frontend.getProcessor();
        if (processor instanceof ClassNameProcessor) {
            processor.setEnvironment(context);
            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                ((ClassNameProcessor)processor).processClassNames();

                context.put(ServiceInfo.class, null);
            }
        }
        generateTypes();

        for (ServiceInfo service : serviceList) {

            context.put(ServiceInfo.class, service);

            validate(service);

            // Build the JavaModel from the ServiceModel
            processor.setEnvironment(context);
            processor.process();

            if (!isSuppressCodeGen()) {
                // Generate artifacts
                for (FrontEndGenerator generator : frontend.getGenerators()) {
                    generator.generate(context);
View Full Code Here

        }
        return profile;
    }

    private Processor loadProcessor(String fullClzName) {
        Processor processor = null;
        try {
            processor = (Processor) Class.forName(fullClzName).newInstance();
        } catch (Exception e) {
            Message msg = new Message("LOAD_PROCESSOR_FAILED", LOG, fullClzName);
            LOG.log(Level.SEVERE, msg.toString());
View Full Code Here

                }
            }
            context.put(ToolConstants.SCHEMA_MAP, schemas);
            context.put(ToolConstants.PORTTYPE_MAP, interfaces);
            context.put(ClassCollector.class, new ClassCollector());
            Processor processor = frontend.getProcessor();
            if (processor instanceof ClassNameProcessor) {
                processor.setEnvironment(context);
                for (ServiceInfo service : serviceList) {

                    context.put(ServiceInfo.class, service);

                    ((ClassNameProcessor)processor).processClassNames();

                    context.put(ServiceInfo.class, null);
                }
            }
            generateTypes();

            for (ServiceInfo service : serviceList) {

                context.put(ServiceInfo.class, service);

                validate(service);

                // Build the JavaModel from the ServiceModel
                processor.setEnvironment(context);
                processor.process();


                if (!isSuppressCodeGen()) {
                    // Generate artifacts
                    for (FrontEndGenerator generator : frontend.getGenerators()) {
View Full Code Here

        assertNotNull(generators);
        assertEquals(2, generators.size());
        assertTrue(generators.get(0) instanceof AntGenerator);
        assertTrue(generators.get(1) instanceof ImplGenerator);
        */
        Processor processor = profile.getProcessor();
        assertNotNull(processor);
        assertTrue(processor instanceof WSDLToJavaProcessor);

        AbstractWSDLBuilder builder = profile.getWSDLBuilder();
        assertNotNull(builder);
View Full Code Here

    public JavaToWSDLContainer(ToolSpec toolspec) throws Exception {
        super(TOOL_NAME, toolspec);
    }

    public void execute(boolean exitOnFinish) throws ToolException {
        Processor processor = null;
        try {
            super.execute(exitOnFinish);
            if (!hasInfoOption()) {
                ToolContext env = new ToolContext();
                env.setParameters(getParametersMap(new HashSet()));
                if (isVerboseOn()) {
                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                }

                processor = new JavaToProcessor();

                processor.setEnvironment(env);
                processor.process();
            }
        } catch (ToolException ex) {
            if (ex.getCause() instanceof BadUsageException) {
                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
                if (isVerboseOn()) {
View Full Code Here

    public JavaToWSContainer(ToolSpec toolspec) throws Exception {
        super(TOOL_NAME, toolspec);
    }

    public void execute(boolean exitOnFinish) throws ToolException {
        Processor processor = null;
        ErrorVisitor errors = new ErrorVisitor();
        try {
            super.execute(exitOnFinish);
            checkParams(errors);
            if (!hasInfoOption()) {
                ToolContext env = new ToolContext();
                env.setParameters(getParametersMap(new HashSet()));
                if (isVerboseOn()) {
                    env.put(ToolConstants.CFG_VERBOSE, Boolean.TRUE);
                }
                processor = new JavaToWSDLProcessor();
                processor.setEnvironment(env);
                processor.process();
                String ft = (String)env.get(ToolConstants.CFG_FRONTEND);
                if (ft == null || "jaxws".equals(ft.toLowerCase())) {
                    ft = "jaxws";
                    env.put(ToolConstants.CFG_FRONTEND, "jaxws");
                    if (env.optionSet(ToolConstants.CFG_SERVER) || env.optionSet(ToolConstants.CFG_CLIENT)) {
                        processor = new JAXWSFrontEndProcessor();
                        processor.setEnvironment(env);
                        processor.process();
                    }
                } else {
                    ft = "simple";
                    env.put(ToolConstants.CFG_FRONTEND, "simple");
                    processor = new SimpleFrontEndProcessor();
                    processor.setEnvironment(env);
                    processor.process();
                }      
            }
        } catch (ToolException ex) {
            if (ex.getCause() instanceof BadUsageException) {
                printUsageException(TOOL_NAME, (BadUsageException)ex.getCause());
View Full Code Here

TOP

Related Classes of org.apache.cxf.tools.common.Processor

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.