Examples of CodeGenerationException


Examples of com.github.sviperll.adt4j.model.util.CodeGenerationException

            result.buildToStringMethod();
            result.buildFactory(constructorMethods);

            return result;
        } catch (JClassAlreadyExistsException ex) {
            throw new CodeGenerationException(ex);
        }
    }
View Full Code Here

Examples of net.sf.cglib.core.CodeGenerationException

                                              MethodInterceptorGenerator.FIND_PROXY_TYPES);
            return (MethodProxy)m.invoke(null, new Object[]{ sig });
        } catch (NoSuchMethodException e) {
            throw new IllegalArgumentException("Class " + type + " does not use a MethodInterceptor");
        } catch (IllegalAccessException e) {
            throw new CodeGenerationException(e);
        } catch (InvocationTargetException e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

       
        Definition definition;
        try {
            definition = readWSDL(uri);
        } catch (WSDLException e) {
            throw new CodeGenerationException(e);
        }
       
        HashSet interestedPorts= ports == null ? null : new HashSet(Arrays.asList(ports));
       
       // Service service=(Service)definition.getServices().values().().next();
       
        HashSet<QName> donePortTypes= new HashSet<QName>();
       
        for (Iterator sIter  = definition.getServices().values().iterator(); sIter.hasNext(); ) {
            Service service = (Service) sIter.next();
           
            QName serviceQname = service.getQName();
             for (Iterator pIter= service.getPorts().values().iterator(); pIter.hasNext(); ) {
                 Port port= (Port) pIter.next();
                if(interestedPorts != null && ! interestedPorts.contains(port.getName())) continue;//not iterested.
                 PortType portType= getPortType(port);
                 if(null == portType) continue; // not connected.
                 QName pQName= portType.getQName();
                 if(donePortTypes.contains(pQName)) continue; //allready did it.
                 donePortTypes.add(pQName);
             
                if (packageName == null) {
                    packageName = XMLNameUtil.getPackageNameFromNamespace(definition.getTargetNamespace());
                }
                JavaTypeMapper typeMapper = new JavaTypeMapper();
                for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
                    typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
                }
                AxisService axisService;
                try {
                    axisService = new WSDL2AxisServiceBuilder(definition, serviceQname, port.getName()).populateService();
                } catch (AxisFault e) {
                    throw new CodeGenerationException(e);
                }
                axisService.setName(port.getBinding().getPortType().getQName().getLocalPart());
                CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP);
                codegenConfigurations.add(codegenConfiguration);
                codegenConfiguration.setAxisService(axisService);
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

            emitter.writeInterface(false);
            }

        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

       
        Definition definition;
        try {
            definition = readWSDL(uri);
        } catch (WSDLException e) {
            throw new CodeGenerationException(e);
        }
       
        HashSet<String> interestedPorts = ports == null ? null : new HashSet<String>(Arrays.asList(ports));
       
       // Service service=(Service)definition.getServices().values().().next();
       
        HashSet<QName> donePortTypes= new HashSet<QName>();
       
        for (Iterator sIter  = definition.getServices().values().iterator(); sIter.hasNext(); ) {
            Service service = (Service) sIter.next();
           
            QName serviceQname = service.getQName();
             for (Iterator pIter= service.getPorts().values().iterator(); pIter.hasNext(); ) {
                 Port port= (Port) pIter.next();
                if(interestedPorts != null && ! interestedPorts.contains(port.getName())) continue;//not iterested.
                 PortType portType= getPortType(port);
                 if(null == portType) continue; // not connected.
                 QName pQName= portType.getQName();
                 if(donePortTypes.contains(pQName)) continue; //allready did it.
                 donePortTypes.add(pQName);
             
                if (packageName == null) {
                    //use JAXWS/JAXB NS->package default algorithm, not the SDO/EMF one
                    packageName = XJC.getDefaultPackageName(definition.getTargetNamespace());
                }
                //
                // Use WSDL4J object to generate exception classes
                //
                generateFaults(packageName, portType, typeMapping);
                JavaTypeMapper typeMapper = new JavaTypeMapper();
                for (Map.Entry<QName, SDODataBindingTypeMappingEntry> e : typeMapping.entrySet()) {
                    typeMapper.addTypeMappingObject(e.getKey(), e.getValue());
                    // Added for generation of exceptions from faults
                    typeMapper.addTypeMappingName(e.getKey(), e.getValue().getClassName());
                }


                AxisService axisService;
                WSDL11ToAxisServiceBuilder builder;
                try {
                    //
                    // Added since at a newer level of Axis2, this doesn't work
                    //  without the setCodegen(true)
                    //
                    builder = new WSDL11ToAxisServiceBuilder(definition, serviceQname, port.getName());
                    builder.setCodegen(true);
                    axisService = builder.populateService();
                } catch (AxisFault e) {
                    throw new CodeGenerationException(e);
                }

                axisService.setName(port.getBinding().getPortType().getQName().getLocalPart());
                CodeGenConfiguration codegenConfiguration = new CodeGenConfiguration(Collections.EMPTY_MAP);
                codegenConfigurations.add(codegenConfiguration);
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

                emitter.writeInterface(false);
            }

        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

            stream.println("        return this.fault;");
            stream.println("    }");
            stream.println("}");
            stream.println();
        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

                }
            }
        } catch (CodeGenerationException ce) {
            throw ce;
        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException


        } catch (CodeGenerationException cgExp) {
            throw cgExp;
        } catch (Exception e) {
            throw new CodeGenerationException(e);
        }
    }
View Full Code Here

Examples of org.apache.axis2.wsdl.codegen.CodeGenerationException

            //mix databinding types!

            String databindingName = rootMappingsElement.
                    getAttribute(DB_FRAMEWORK_ATTRIBUTE_NAME);
            if (!databindingName.equals(configuration.getDatabindingType())) {
                throw new CodeGenerationException(
                        CodegenMessages.
                                getMessage("extension.databindingMismatch")
                );
            }
            configuration.
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.