Search in sources :

Example 1 with FaultBean

use of org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.FaultBean in project cxf by apache.

the class FaultBeanGenerator method generateBeanClasses.

protected Collection<JavaClass> generateBeanClasses(final ServiceInfo serviceInfo) {
    Set<Class<?>> exceptionClasses = new HashSet<>();
    String seiPackageName = null;
    for (OperationInfo op : serviceInfo.getInterface().getOperations()) {
        Method method = (Method) op.getProperty("operation.method");
        exceptionClasses.addAll(getExceptionClasses(method));
        seiPackageName = getSEIPackage(method);
    }
    Collection<JavaClass> faultBeanClasses = new HashSet<>();
    String defaultPackage = seiPackageName + ".jaxws";
    FaultBean bean = new FaultBean();
    for (Class<?> clz : exceptionClasses) {
        if (!bean.faultBeanExists(clz)) {
            faultBeanClasses.add(bean.transform(clz, defaultPackage));
        }
    }
    return faultBeanClasses;
}
Also used : OperationInfo(org.apache.cxf.service.model.OperationInfo) JavaClass(org.apache.cxf.tools.common.model.JavaClass) JavaClass(org.apache.cxf.tools.common.model.JavaClass) Method(java.lang.reflect.Method) FaultBean(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.FaultBean) HashSet(java.util.HashSet)

Aggregations

Method (java.lang.reflect.Method)1 HashSet (java.util.HashSet)1 OperationInfo (org.apache.cxf.service.model.OperationInfo)1 JavaClass (org.apache.cxf.tools.common.model.JavaClass)1 FaultBean (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.FaultBean)1