Examples of Emitter


Examples of net.sf.saxon.event.Emitter

        return list.iterator();
    }

    public TailCall processLeavingTail(XPathContext context) throws XPathException {
        Controller controller = context.getController();
        Emitter emitter = controller.getMessageEmitter();
        if (emitter==null) {
            emitter = controller.makeMessageEmitter();
        }
        if (emitter.getWriter()==null) {
            emitter.setWriter(new OutputStreamWriter(System.err));
        }

        TreeReceiver rec = new TreeReceiver(emitter);
       
        XPathContext c2 = context.newMinorContext();
        c2.setOrigin(this);
        Properties props = new Properties();
        props.put(OutputKeys.OMIT_XML_DECLARATION, "yes");
        emitter.setOutputProperties(props);
        c2.changeOutputDestination(props, rec, false, Validation.PRESERVE, null);

        if (select != null) {
            SequenceIterator iter = select.iterate(c2);
            while (true) {
View Full Code Here

Examples of org.apache.axis.wsdl.Emitter

            log("\tdeployScope:" + deployScope, Project.MSG_VERBOSE);
            log("\tURL:" + url, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            JavaWriterFactory writerFactory = new JavaWriterFactory();
            Emitter emitter = new Emitter(writerFactory);
            writerFactory.setEmitter(emitter);

            if ("application".equalsIgnoreCase(deployScope)) {
                emitter.setScope(Emitter.APPLICATION_SCOPE);
            }
            else if ("request".equalsIgnoreCase(deployScope)) {
                emitter.setScope(Emitter.REQUEST_SCOPE);
            }
            else if ("session".equalsIgnoreCase(deployScope)) {
                emitter.setScope(Emitter.SESSION_SCOPE);
            }
            else if ("none".equalsIgnoreCase(deployScope)) {
                emitter.setScope(Emitter.NO_EXPLICIT_SCOPE);
            }
            else {
                log("Unrecognized scope:  " + deployScope + ".  Ignoring it.", Project.MSG_VERBOSE);
            }
            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            emitter.generateTestCase(testCase);
            emitter.generateImports(!noImports);
            emitter.setOutputDir(output);
            emitter.generateMessageContext(messageContext);
            emitter.generateSkeleton(skeleton);
            emitter.verbose(verbose);
            emitter.emit(url);
        } catch (Throwable t) {
            throw new BuildException("Error while running " + getClass().getName(), t);
        }
    }
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

//                    locationUrl = url;
//                    interfaceNamespace = url;
//                }
//            }

            Emitter emitter = new Emitter();

            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name
            String alias = (String)service.getOption("alias");
            if(alias != null) emitter.setServiceElementName(alias);

            Style style = serviceDesc.getStyle();
            if (style == Style.RPC) {
                emitter.setMode(Emitter.MODE_RPC);
            } else if (style == Style.DOCUMENT) {
                emitter.setMode(Emitter.MODE_DOCUMENT);
            } else if (style == Style.WRAPPED) {
                emitter.setMode(Emitter.MODE_DOC_WRAPPED);
            }

            emitter.setClsSmart(serviceDesc.getImplClass(), locationUrl);

            // If a wsdl target namespace was provided, use the targetNamespace.
            // Otherwise use the interfaceNamespace constructed above.
            String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
            if (targetNamespace == null ||
                targetNamespace.length() == 0) {
                targetNamespace = interfaceNamespace;
            }
            emitter.setIntfNamespace(targetNamespace);

            emitter.setLocationUrl(locationUrl);
            emitter.setServiceDesc(serviceDesc);
            emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                   getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC));
            emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                          getDefaultTypeMapping());

            String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
            String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
            String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);

            if (wsdlPortType != null && wsdlPortType.length() > 0) {
                emitter.setPortTypeName(wsdlPortType);
            }
            if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
                emitter.setServiceElementName(wsdlServiceElement);
            }
            if (wsdlServicePort != null && wsdlServicePort.length() > 0) {
                emitter.setServicePortName(wsdlServicePort);
            }

            Document  doc = emitter.emit(Emitter.MODE_ALL);

            msgContext.setProperty("WSDL", doc);
        } catch (NoClassDefFoundError e) {
            entLog.info( Messages.getMessage("toAxisFault00"), e );
            throw new AxisFault(e.toString(), e);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

    /**
     * Instantiate an Emitter         
     */
    protected Emitter createEmitter() {
        return new Emitter();
    } // createEmitter
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            log("\toutputImpl:" + outputImpl, Project.MSG_VERBOSE);
            log("\tnamespaceImpl:" + namespaceImpl, Project.MSG_VERBOSE);
            log("\tlocationImport:" + locationImport, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            Emitter emitter = new Emitter();

            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null) {
                emitter.setServicePortName(servicePortName);
            }
            if (portTypeName != null) {
                emitter.setPortTypeName(portTypeName);
            }
            if (bindingName != null) {
                emitter.setBindingName(bindingName);
            }
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null) {
                emitter.setImplCls(implClass);
            }
            if (exclude != null) {
                emitter.setDisallowedMethods(exclude);
            }
            if (stopClasses != null) {
                emitter.setStopClasses(stopClasses);
            }

            if (tm.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }
            if (style != null) {
                if (style.equalsIgnoreCase("DOCUMENT")) {
                    emitter.setMode(Emitter.MODE_DOCUMENT);
                } else if (style.equalsIgnoreCase("RPC")) {
                    emitter.setMode(Emitter.MODE_RPC);
                } else if (style.equalsIgnoreCase("WRAPPED")) {
                    emitter.setMode(Emitter.MODE_DOC_WRAPPED);
                }
            }
            if (input != null) {
                emitter.setInputWSDL(input);
            }
            emitter.setIntfNamespace(namespace);
            emitter.setImplNamespace(namespaceImpl);
            emitter.setLocationUrl(location);
            emitter.setImportUrl(locationImport);
            emitter.setUseInheritedMethods(useInheritedMethods);
            if (outputImpl == null) {
                // Normal case
                emitter.emit(output, Emitter.MODE_ALL);
            } else {
                // Emit interface and implementation wsdls
                emitter.emit(output, outputImpl);
            }
        } catch (Throwable t) {
            StringWriter writer = new StringWriter();
            t.printStackTrace(new PrintWriter(writer));
            log(writer.getBuffer().toString(), Project.MSG_ERR);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

        }
        try {
            traceParams(Project.MSG_VERBOSE);
            validate();
            // Instantiate the emitter
            Emitter emitter = new Emitter();
            //do the mappings, packages are the key for this map
            mappings.execute(this,namespaceMap, true);
            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null) {
                emitter.setServicePortName(servicePortName);
            }
            if (portTypeName != null) {
                emitter.setPortTypeName(portTypeName);
            }
            if (bindingName != null) {
                emitter.setBindingName(bindingName);
            }
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null) {
                emitter.setImplCls(implClass);
            }
            if (exclude != null) {
                emitter.setDisallowedMethods(exclude);
            }
            if (stopClasses != null) {
                emitter.setStopClasses(stopClasses);
            }
            if (extraClasses != null) {
                emitter.setExtraClasses(extraClasses);
            }

            if (typeMappingVersion.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAPEncodingTypeMappingImpl.create());
            }
            if (style != null) {
                emitter.setStyle(style);
            }

            if (use != null) {
                emitter.setUse(use);
            }

            if (importSchema != null) {
                emitter.setInputSchema(importSchema);
            }
            if (input != null) {
                emitter.setInputWSDL(input);
            }
            emitter.setIntfNamespace(namespace);
            emitter.setImplNamespace(namespaceImpl);
            emitter.setLocationUrl(location);
            emitter.setImportUrl(locationImport);
            emitter.setUseInheritedMethods(useInheritedMethods);
            if(serviceElementName!=null) {
                emitter.setServiceElementName( serviceElementName);
            }
            if(methods!=null) {
                emitter.setAllowedMethods(methods);
            }
            if (outputImpl == null) {
                // Normal case
                emitter.emit(output, Emitter.MODE_ALL);
            } else {
                // Emit interface and implementation wsdls
                emitter.emit(output, outputImpl);
            }


        } catch(BuildException b) {
            //pass build exceptions up the wire
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            log("\toutputImpl:" + outputImpl, Project.MSG_VERBOSE);
            log("\tnamespaceImpl:" + namespaceImpl, Project.MSG_VERBOSE);
            log("\tlocationImport:" + locationImport, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            Emitter emitter = new Emitter();

            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null) {
                emitter.setServicePortName(servicePortName);
            }
            if (portTypeName != null) {
                emitter.setPortTypeName(portTypeName);
            }
            if (bindingName != null) {
                emitter.setBindingName(bindingName);
            }
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null) {
                emitter.setImplCls(implClass);
            }
            if (exclude != null) {
                emitter.setDisallowedMethods(exclude);
            }
            if (stopClasses != null) {
                emitter.setStopClasses(stopClasses);
            }

            if (tm.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }
            if (style != null) {
                if (style.equalsIgnoreCase("DOCUMENT")) {
                    emitter.setMode(Emitter.MODE_DOCUMENT);
                } else if (style.equalsIgnoreCase("RPC")) {
                    emitter.setMode(Emitter.MODE_RPC);
                }
            }
            if (input != null) {
                emitter.setInputWSDL(input);
            }
            emitter.setIntfNamespace(namespace);
            emitter.setImplNamespace(namespaceImpl);
            emitter.setLocationUrl(location);
            emitter.setImportUrl(locationImport);
            emitter.setUseInheritedMethods(useInheritedMethods);
            if (outputImpl == null) {
                // Normal case
                emitter.emit(output, Emitter.MODE_ALL);
            } else {
                // Emit interface and implementation wsdls
                emitter.emit(output, outputImpl);
            }
        } catch (Throwable t) {
            StringWriter writer = new StringWriter();
            t.printStackTrace(new PrintWriter(writer));
            log(writer.getBuffer().toString(), Project.MSG_ERR);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

            log("\toutputImpl:" + outputImpl, Project.MSG_VERBOSE);
            log("\tnamespaceImpl:" + namespaceImpl, Project.MSG_VERBOSE);
            log("\tlocationImport:" + locationImport, Project.MSG_VERBOSE);
           
            // Instantiate the emitter
            Emitter emitter = new Emitter();

            if (!namespaceMap.isEmpty()) {
                emitter.setNamespaceMap(namespaceMap);
            }
            if (servicePortName != null) {
                emitter.setServicePortName(servicePortName);
            }
            if (portTypeName != null) {
                emitter.setPortTypeName(portTypeName);
            }
            if (bindingName != null) {
                emitter.setBindingName(bindingName);
            }
            log("Java2WSDL " + className, Project.MSG_INFO);
            emitter.setCls(className);
            if (implClass != null) {
                emitter.setImplCls(implClass);
            }
            if (exclude != null) {
                emitter.setDisallowedMethods(exclude);
            }
            if (stopClasses != null) {
                emitter.setStopClasses(stopClasses);
            }

            if (tm.equals("1.1")) {
                emitter.setDefaultTypeMapping(DefaultTypeMappingImpl.getSingleton());
            } else {
                emitter.setDefaultTypeMapping(DefaultSOAP12TypeMappingImpl.create());
            }
            if (style != null) {
                if (style.equalsIgnoreCase("DOCUMENT")) {
                    emitter.setMode(Emitter.MODE_DOCUMENT);
                } else if (style.equalsIgnoreCase("RPC")) {
                    emitter.setMode(Emitter.MODE_RPC);
                }
            }
            if (input != null) {
                emitter.setInputWSDL(input);
            }
            emitter.setIntfNamespace(namespace);
            emitter.setImplNamespace(namespaceImpl);
            emitter.setLocationUrl(location);
            emitter.setImportUrl(locationImport);
            emitter.setUseInheritedMethods(useInheritedMethods);
            if (outputImpl == null) {
                // Normal case
                emitter.emit(output, Emitter.MODE_ALL);
            } else {
                // Emit interface and implementation wsdls
                emitter.emit(output, outputImpl);
            }
        } catch (Throwable t) {
            StringWriter writer = new StringWriter();
            t.printStackTrace(new PrintWriter(writer));
            log(writer.getBuffer().toString(), Project.MSG_ERR);
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

    /**
     * Instantiate an Emitter         
     */
    protected Emitter createEmitter() {
        return new Emitter();
    } // createEmitter
View Full Code Here

Examples of org.apache.axis.wsdl.fromJava.Emitter

//                    locationUrl = url;
//                    interfaceNamespace = url;
//                }
//            }

            Emitter emitter = new Emitter();

            // service alias may be provided if exact naming is required,
            // otherwise Axis will name it according to the implementing class name
            String alias = (String)service.getOption("alias");
            if(alias != null) emitter.setServiceElementName(alias);

            emitter.setMode( (service.getStyle() == Style.RPC)
                             ? Emitter.MODE_RPC
                             : Emitter.MODE_DOCUMENT);

            emitter.setClsSmart(serviceDesc.getImplClass(), locationUrl);

            // If a wsdl target namespace was provided, use the targetNamespace.
            // Otherwise use the interfaceNamespace constructed above.
            String targetNamespace = (String) service.getOption(OPTION_WSDL_TARGETNAMESPACE);
            if (targetNamespace == null ||
                targetNamespace.length() == 0) {
                targetNamespace = interfaceNamespace;
            }
            emitter.setIntfNamespace(targetNamespace);

            emitter.setLocationUrl(locationUrl);
            emitter.setServiceDesc(serviceDesc);
            emitter.setTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                   getTypeMapping(Constants.URI_DEFAULT_SOAP_ENC));
            emitter.setDefaultTypeMapping((TypeMapping)msgContext.getTypeMappingRegistry().
                                          getDefaultTypeMapping());

            String wsdlPortType = (String) service.getOption(OPTION_WSDL_PORTTYPE);
            String wsdlServiceElement = (String) service.getOption(OPTION_WSDL_SERVICEELEMENT);
            String wsdlServicePort = (String) service.getOption(OPTION_WSDL_SERVICEPORT);

            if (wsdlPortType != null && wsdlPortType.length() > 0) {
                emitter.setPortTypeName(wsdlPortType);
            }
            if (wsdlServiceElement != null && wsdlServiceElement.length() > 0) {
                emitter.setServiceElementName(wsdlServiceElement);
            }
            if (wsdlServicePort != null && wsdlServicePort.length() > 0) {
                emitter.setServicePortName(wsdlServicePort);
            }

            Document  doc = emitter.emit(Emitter.MODE_ALL);

            msgContext.setProperty("WSDL", doc);
        } catch (NoClassDefFoundError e) {
            entLog.info( JavaUtils.getMessage("toAxisFault00"), e );
            throw new AxisFault(e.toString(), e);
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.