Examples of JavaExceptionClass


Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        boolean samePackage = method.getInterface().getPackageName().equals(packageName);
        method.addException(new JavaException(name, samePackage ? name : fullClassName, namespace));

        List<MessagePartInfo> faultParts = faultMessage.getMessageParts();

        JavaExceptionClass expClass = new JavaExceptionClass(model);
        expClass.setName(name);
        expClass.setNamespace(namespace);
        expClass.setPackageName(packageName);

        for (MessagePartInfo part : faultParts) {
            String fName = null;
            String fNamespace = null;

            if (part.getElementQName() != null) {
                fNamespace = part.getElementQName().getNamespaceURI();
                //fNamespace = part.getConcreteName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            } else {
                fNamespace = part.getTypeQName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            }

            if (StringUtils.isEmpty(fNamespace)) {
                fNamespace = namespace;
            }

            String fType = ProcessorUtil.getType(part, context, false);
           
            //REVISIT - custom JAXB package names
            String fPackageName = method.getInterface().getPackageName();


            JavaField fField = new JavaField(fName, fType, fNamespace);
            fField.setQName(ProcessorUtil.getElementName(part));

            if (!method.getInterface().getPackageName().equals(fPackageName)) {
                fField.setClassName(ProcessorUtil.getFullClzName(part, context, false));
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.getType(part, context, true));
            }

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

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        boolean samePackage = method.getInterface().getPackageName().equals(packageName);
        method.addException(new JavaException(name, samePackage ? name : fullClassName, namespace));

        List<MessagePartInfo> faultParts = faultMessage.getMessageParts();

        JavaExceptionClass expClass = new JavaExceptionClass(model);
        expClass.setName(name);
        expClass.setNamespace(namespace);
        expClass.setPackageName(packageName);

        for (MessagePartInfo part : faultParts) {
            String fName = null;
            String fNamespace = null;

            if (part.getElementQName() != null) {
                fNamespace = part.getElementQName().getNamespaceURI();
                //fNamespace = part.getConcreteName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            } else {
                fNamespace = part.getTypeQName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            }

            if (StringUtils.isEmpty(fNamespace)) {
                fNamespace = namespace;
            }

            String fType = ProcessorUtil.getType(part, context, false);

            //REVISIT - custom JAXB package names
            String fPackageName = method.getInterface().getPackageName();


            JavaField fField = new JavaField(fName, fType, fNamespace);
            fField.setQName(ProcessorUtil.getElementName(part));

            if (!method.getInterface().getPackageName().equals(fPackageName)) {
                fField.setClassName(ProcessorUtil.getFullClzName(part, context, false));
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.getType(part, context, true));
            }

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

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        Map<String, JavaExceptionClass> exceptionClasses = javaModel
                .getExceptionClasses();
        for (Iterator iter = exceptionClasses.keySet().iterator(); iter
                .hasNext();) {
            String expClassName = (String)iter.next();
            JavaExceptionClass expClz =
                exceptionClasses.get(expClassName);

            clearAttributes();
            setAttributes("expClass", expClz);
            for (JavaField jf : expClz.getFields()) {
                setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
            }
            setCommonAttributes();
            doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
                    expClz.getName()));
        }
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        boolean samePackage = method.getInterface().getPackageName().equals(packageName);
        method.addException(new JavaException(name, samePackage ? name : fullClassName, namespace));

        List<MessagePartInfo> faultParts = faultMessage.getMessageParts();

        JavaExceptionClass expClass = new JavaExceptionClass(model);
        expClass.setName(name);
        expClass.setNamespace(namespace);
        expClass.setPackageName(packageName);

        for (MessagePartInfo part : faultParts) {
            String fName = null;
            String fNamespace = null;

            if (part.getElementQName() != null) {
                fNamespace = part.getElementQName().getNamespaceURI();
                //fNamespace = part.getConcreteName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            } else {
                fNamespace = part.getTypeQName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            }

            if (StringUtils.isEmpty(fNamespace)) {
                fNamespace = namespace;
            }

            String fType = ProcessorUtil.getType(part, context, false);

            //REVISIT - custom JAXB package names
            String fPackageName = method.getInterface().getPackageName();


            JavaField fField = new JavaField(fName, fType, fNamespace);
            fField.setQName(ProcessorUtil.getElementName(part));

            if (!method.getInterface().getPackageName().equals(fPackageName)) {
                fField.setClassName(ProcessorUtil.getFullClzName(part, context, false));
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.getType(part, context, true));
            }

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

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        Map<String, JavaExceptionClass> exceptionClasses = javaModel
                .getExceptionClasses();
        for (Iterator iter = exceptionClasses.keySet().iterator(); iter
                .hasNext();) {
            String expClassName = (String)iter.next();
            JavaExceptionClass expClz =
                exceptionClasses.get(expClassName);

            clearAttributes();
            setAttributes("expClass", expClz);
            for (JavaField jf : expClz.getFields()) {
                setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
            }
            setCommonAttributes();
            doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
                    expClz.getName()));
        }
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        method.addException(new JavaException(name, samePackage ? name : fullClassName, 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);
     
        for (Part part : faultValues) {
            String fName;
            String fNamespace;
           
            if (part.getElementName() != null) {
                fName = part.getElementName().getLocalPart();              
                fNamespace = part.getElementName().getNamespaceURI();
              
                /*
                 * org.apache.cxf.common.i18n.Message msg = new
                 * org.apache.cxf.common.i18n.Message("WSDL_FAULT_MSG_PART_ELEMENT_MISSING_ERROR",
                 * LOG, faultMessage, part.getName()); throw new
                 * ToolException(msg);
                 */

            } else {
                fName = part.getName();
                fNamespace = part.getTypeName().getNamespaceURI();

            }
           
            String fType = ProcessorUtil.getType(part, env, false);
            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(ProcessorUtil.getFullClzName(part,
                                                                 env, this.collector, false));               
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.getType(part, env, true));
            }

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

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        for (JavaModel javaModel : map.values()) {

            Map<String, JavaExceptionClass> exceptionClasses = javaModel
                    .getExceptionClasses();
            for (String expClassName : exceptionClasses.keySet()) {
                JavaExceptionClass expClz =
                    exceptionClasses.get(expClassName);
   
                clearAttributes();
               
                if (penv.containsKey(ToolConstants.CFG_FAULT_SERIAL_VERSION_UID)) {
                    String faultSerialVersionUID
                        = penv.get(ToolConstants.CFG_FAULT_SERIAL_VERSION_UID).toString();
                    setAttributes("faultSerialVersionUID", faultSerialVersionUID);
                    if ("FQCN".equalsIgnoreCase(faultSerialVersionUID)) {
                        setAttributes("suid", generateHashSUID(expClz.getFullClassName()));
                    } else if ("TIMESTAMP".equalsIgnoreCase(faultSerialVersionUID)) {
                        setAttributes("suid", generateTimestampSUID());
                    } else if ("NONE".equalsIgnoreCase(faultSerialVersionUID)) {
                        //nothing
                        setAttributes("suid", "");
                    } else {
                        //do a quick Parse to make sure it looks like a Long
                        try {
                            Long.parseLong(faultSerialVersionUID);
                        } catch (NumberFormatException nfe) {
                            throw new ToolException(nfe);
                        }
                        setAttributes("suid", faultSerialVersionUID);
                    }
                } else {
                    setAttributes("suid", "");
                }
                setAttributes("expClass", expClz);
                String exceptionSuperclass;
                if (penv.containsKey(ToolConstants.CFG_EXCEPTION_SUPER)) {
                    exceptionSuperclass = penv.get(ToolConstants.CFG_EXCEPTION_SUPER).toString();
                } else {
                    exceptionSuperclass = "java.lang.Exception";
                }
                String simpleName = exceptionSuperclass.indexOf('.') == -1 ? exceptionSuperclass
                    : exceptionSuperclass.substring(exceptionSuperclass.lastIndexOf('.') + 1);
                String exceptionSuperclassString = simpleName;
                for (JavaField jf : expClz.getFields()) {
                    String jfClassName = jf.getClassName();
                    if (jfClassName.substring(jfClassName.lastIndexOf(".") + 1)
                        .equals(simpleName)) {
                        exceptionSuperclassString = exceptionSuperclass;
                    }
                    setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
                }
                ClassCollector collector = penv.get(ClassCollector.class);
                for (String pkg : collector.getTypesPackages()) {
                    if (collector.containTypesClass(pkg, simpleName)) {
                        exceptionSuperclassString = exceptionSuperclass;
                    }
                }
                if (expClz.getName().equals(exceptionSuperclassString)) {
                    exceptionSuperclassString = exceptionSuperclass;
                }
                setAttributes("exceptionSuperclass", exceptionSuperclassString);

                setCommonAttributes();
                doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
                        expClz.getName()));
            }
        }
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        method.addException(new JavaException(faultMessage.getName().getLocalPart(),
                                              samePackage ? name : fullClassName, namespace));

        List<MessagePartInfo> faultParts = faultMessage.getMessageParts();

        JavaExceptionClass expClass = new JavaExceptionClass(model);
        expClass.setName(name);
        expClass.setNamespace(namespace);
        expClass.setPackageName(packageName);

        for (MessagePartInfo part : faultParts) {
            String fName = null;
            String fNamespace = null;

            if (part.getElementQName() != null) {
                fNamespace = part.getElementQName().getNamespaceURI();
                //fNamespace = part.getConcreteName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            } else {
                fNamespace = part.getTypeQName().getNamespaceURI();
                fName = part.getConcreteName().getLocalPart();
            }

            if (StringUtils.isEmpty(fNamespace)) {
                fNamespace = namespace;
            }

            String fType = ProcessorUtil.getType(part, context, false);

            //REVISIT - custom JAXB package names
            String fPackageName = method.getInterface().getPackageName();


            JavaField fField = new JavaField(fName, fType, fNamespace);
            fField.setQName(ProcessorUtil.getElementName(part));

            if (!method.getInterface().getPackageName().equals(fPackageName)) {
                fField.setClassName(ProcessorUtil.getFullClzName(part, context, false));
            }
            if (!fType.equals(ProcessorUtil.resolvePartType(part))) {
                fField.setClassName(ProcessorUtil.getType(part, context, true));
            }

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

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

        Map<String, JavaExceptionClass> exceptionClasses = javaModel
                .getExceptionClasses();
        for (Iterator iter = exceptionClasses.keySet().iterator(); iter
                .hasNext();) {
            String expClassName = (String)iter.next();
            JavaExceptionClass expClz =
                exceptionClasses.get(expClassName);

            clearAttributes();
            setAttributes("suid", getSUID());
            setAttributes("expClass", expClz);
            for (JavaField jf : expClz.getFields()) {
                setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
            }
            setCommonAttributes();
            doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
                    expClz.getName()));
        }
    }
View Full Code Here

Examples of org.apache.cxf.tools.common.model.JavaExceptionClass

            Map<String, JavaExceptionClass> exceptionClasses = javaModel
                    .getExceptionClasses();
            for (Iterator iter = exceptionClasses.keySet().iterator(); iter
                    .hasNext();) {
                String expClassName = (String)iter.next();
                JavaExceptionClass expClz =
                    exceptionClasses.get(expClassName);
   
                clearAttributes();
               
                if (penv.containsKey(ToolConstants.CFG_FAULT_SERIAL_VERSION_UID)) {
                    String faultSerialVersionUID
                        = penv.get(ToolConstants.CFG_FAULT_SERIAL_VERSION_UID).toString();
                    setAttributes("faultSerialVersionUID", faultSerialVersionUID);
                    if ("FQCN".equalsIgnoreCase(faultSerialVersionUID)) {
                        setAttributes("suid", generateHashSUID(expClz.getFullClassName()));
                    } else if ("TIMESTAMP".equalsIgnoreCase(faultSerialVersionUID)) {
                        setAttributes("suid", generateTimestampSUID());
                    } else if ("NONE".equalsIgnoreCase(faultSerialVersionUID)) {
                        //nothing
                        setAttributes("suid", "");
                    } else {
                        //do a quick Parse to make sure it looks like a Long
                        try {
                            Long.parseLong(faultSerialVersionUID);
                        } catch (NumberFormatException nfe) {
                            throw new ToolException(nfe);
                        }
                        setAttributes("suid", faultSerialVersionUID);
                    }
                } else {
                    setAttributes("suid", "");
                }
                setAttributes("expClass", expClz);
                String exceptionSuperclass = "Exception";
                for (JavaField jf : expClz.getFields()) {
                    String jfClassName = jf.getClassName();
                    if (jfClassName.substring(jfClassName.lastIndexOf(".") + 1).equals("Exception")) {
                        exceptionSuperclass = "java.lang.Exception";
                    }
                    setAttributes("paraName", ProcessorUtil.mangleNameToVariableName(jf.getName()));
                }
               
               
                if (expClz.getName().equals(exceptionSuperclass)) {
                    exceptionSuperclass = "java.lang.Exception";
                }
                setAttributes("exceptionSuperclass", exceptionSuperclass);

                setCommonAttributes();
                doWrite(FAULT_TEMPLATE, parseOutputName(expClz.getPackageName(),
                        expClz.getName()));
            }
        }
    }
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.