Search in sources :

Example 1 with ResponseWrapper

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

the class WrapperBeanGenerator method generateBeanClasses.

protected Collection<JavaClass> generateBeanClasses(final ServiceInfo serviceInfo) {
    Collection<JavaClass> wrapperClasses = new HashSet<>();
    for (OperationInfo op : serviceInfo.getInterface().getOperations()) {
        if (op.getUnwrappedOperation() != null) {
            if (op.hasInput()) {
                RequestWrapper requestWrapper = new RequestWrapper();
                requestWrapper.setOperationInfo(op);
                JavaClass jClass = requestWrapper.buildWrapperBeanClass();
                if (requestWrapper.isWrapperBeanClassNotExist()) {
                    wrapperClasses.add(jClass);
                }
            }
            if (op.hasOutput()) {
                ResponseWrapper responseWrapper = new ResponseWrapper();
                responseWrapper.setOperationInfo(op);
                JavaClass jClass = responseWrapper.buildWrapperBeanClass();
                if (responseWrapper.isWrapperBeanClassNotExist()) {
                    wrapperClasses.add(jClass);
                }
            }
        }
    }
    return wrapperClasses;
}
Also used : OperationInfo(org.apache.cxf.service.model.OperationInfo) JavaClass(org.apache.cxf.tools.common.model.JavaClass) RequestWrapper(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.RequestWrapper) ResponseWrapper(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.ResponseWrapper) HashSet(java.util.HashSet)

Aggregations

HashSet (java.util.HashSet)1 OperationInfo (org.apache.cxf.service.model.OperationInfo)1 JavaClass (org.apache.cxf.tools.common.model.JavaClass)1 RequestWrapper (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.RequestWrapper)1 ResponseWrapper (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.ResponseWrapper)1