Package org.objectweb.celtix.tools.common.model

Examples of org.objectweb.celtix.tools.common.model.JavaModel


        return collision;
    }

    @SuppressWarnings("unchecked")
    private void processFault(JavaMethod method, Fault fault) throws ToolException {
        JavaModel model = method.getInterface().getJavaModel();
        Message faultMessage = fault.getMessage();
        String name = ProcessorUtil.mangleNameToClassName(faultMessage.getQName().getLocalPart());
        String namespace = faultMessage.getQName().getNamespaceURI();
        String packageName = ProcessorUtil.parsePackageName(namespace, env.mapPackageName(namespace));

        while (isNameCollision(packageName, name)) {
            name = name + "_Exception";
        }

        collector.addExceptionClassName(packageName, name, packageName + "." + name);

        method.addException(new JavaException(name, name, namespace));

        Map<String, Part> faultParts = faultMessage.getParts();
        Collection<Part> faultValues = faultParts.values();
       
        JavaExceptionClass expClass = new JavaExceptionClass(model);
        expClass.setName(name);
        expClass.setNamespace(namespace);
        expClass.setPackageName(packageName);
        S2JJAXBModel jaxbModel = (S2JJAXBModel)env.get(ToolConstants.RAW_JAXB_MODEL);
        for (Part part : faultValues) {

            String fName = part.getName();
            String fType = ProcessorUtil.resolvePartType(part, jaxbModel);
            String fNamespace = ProcessorUtil.resolvePartNamespace(part);
            String fPackageName = ProcessorUtil.parsePackageName(fNamespace, env.mapPackageName(fNamespace));

            JavaField fField = new JavaField(fName, fType, fNamespace);
            fField.setQName(ProcessorUtil.getElementName(part));
           
            if (!method.getInterface().getPackageName().equals(fPackageName)) {
                fField.setClassName(fPackageName + "." + fType);
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.resolvePartType(part, jaxbModel, true));
            }

            expClass.addField(fField);
        }
        model.addExceptionClass(name, expClass);
    }
View Full Code Here


        if (isSOAP12Binding(wsdlDefinition)) {
            Message msg = new Message("SOAP12_UNSUPPORTED", LOG);
            throw new ToolException(msg);
        }
        generateTypes();
        JavaModel jmodel = wsdlDefinitionToJavaModel(getWSDLDefinition());
        if (jmodel == null) {
            Message msg = new Message("FAIL_TO_CREATE_JAVA_MODEL", LOG);
            throw new ToolException(msg);
        }
        registerGenerators(jmodel);
View Full Code Here

        }
    }

    private JavaModel wsdlDefinitionToJavaModel(Definition definition) throws ToolException {
        JavaModel javaModel = new JavaModel();
        getEnvironment().put(ToolConstants.RAW_JAXB_MODEL, getRawJaxbModel());

        javaModel.setJAXWSBinding(customizing(definition));

        Map portTypes = definition.getPortTypes();

        for (Iterator iter = portTypes.keySet().iterator(); iter.hasNext();) {
            PortType portType = (PortType)portTypes.get(iter.next());
View Full Code Here

TOP

Related Classes of org.objectweb.celtix.tools.common.model.JavaModel

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.