Search in sources :

Example 1 with JavaSimpleType

use of com.sun.tools.ws.processor.model.java.JavaSimpleType in project metro-jax-ws by eclipse-ee4j.

the class JAXBModelBuilder method getJAXBType.

public JAXBType getJAXBType(QName qname) {
    JAXBMapping mapping = jaxbModel.get(qname);
    if (mapping == null) {
        return null;
    }
    JavaType javaType = new JavaSimpleType(mapping.getType());
    return new JAXBType(qname, javaType, mapping, jaxbModel);
}
Also used : JavaType(com.sun.tools.ws.processor.model.java.JavaType) JAXBMapping(com.sun.tools.ws.processor.model.jaxb.JAXBMapping) JavaSimpleType(com.sun.tools.ws.processor.model.java.JavaSimpleType) JAXBType(com.sun.tools.ws.processor.model.jaxb.JAXBType)

Example 2 with JavaSimpleType

use of com.sun.tools.ws.processor.model.java.JavaSimpleType in project metro-jax-ws by eclipse-ee4j.

the class ModelerUtils method createRpcLitParameters.

public static List<Parameter> createRpcLitParameters(Message message, Block block, S2JJAXBModel jaxbModel, ErrorReceiverFilter errReceiver) {
    RpcLitStructure rpcStruct = (RpcLitStructure) block.getType();
    List<Parameter> parameters = new ArrayList<>();
    for (MessagePart part : message.getParts()) {
        if (!ModelerUtils.isBoundToSOAPBody(part))
            continue;
        QName name = part.getDescriptor();
        TypeAndAnnotation typeAndAnn = jaxbModel.getJavaType(name);
        if (typeAndAnn == null) {
            String msgQName = "{" + message.getDefining().getTargetNamespaceURI() + "}" + message.getName();
            errReceiver.error(part.getLocator(), ModelerMessages.WSDLMODELER_RPCLIT_UNKOWNSCHEMATYPE(name.toString(), part.getName(), msgQName));
            throw new AbortException();
        }
        String type = typeAndAnn.getTypeClass().fullName();
        type = ClassNameInfo.getGenericClass(type);
        RpcLitMember param = new RpcLitMember(new QName("", part.getName()), type);
        JavaType javaType = new JavaSimpleType(new JAXBTypeAndAnnotation(typeAndAnn));
        param.setJavaType(javaType);
        rpcStruct.addRpcLitMember(param);
        Parameter parameter = ModelerUtils.createParameter(part.getName(), param, block);
        parameter.setEmbedded(true);
        parameters.add(parameter);
    }
    return parameters;
}
Also used : QName(javax.xml.namespace.QName) MessagePart(com.sun.tools.ws.wsdl.document.MessagePart) JavaSimpleType(com.sun.tools.ws.processor.model.java.JavaSimpleType) ArrayList(java.util.ArrayList) JavaType(com.sun.tools.ws.processor.model.java.JavaType) TypeAndAnnotation(com.sun.tools.xjc.api.TypeAndAnnotation) Parameter(com.sun.tools.ws.processor.model.Parameter) AbortException(com.sun.tools.ws.wscompile.AbortException)

Example 3 with JavaSimpleType

use of com.sun.tools.ws.processor.model.java.JavaSimpleType in project metro-jax-ws by eclipse-ee4j.

the class ModelerUtils method createUnwrappedParameter.

/**
 * @return unwrapped parameter
 */
private static Parameter createUnwrappedParameter(JAXBProperty prop, JAXBType jaxbType, Block block, JAXBStructuredType type, JavaStructureType jst) {
    QName elementName = prop.getElementName();
    JavaType javaType = new JavaSimpleType(prop.getType());
    JAXBElementMember eType = new JAXBElementMember(elementName, jaxbType);
    JavaStructureMember jsm = new JavaStructureMember(elementName.getLocalPart(), javaType, eType);
    eType.setJavaStructureMember(jsm);
    jst.add(jsm);
    eType.setProperty(prop);
    type.add(eType);
    JAXBType t = new JAXBType(elementName, javaType, jaxbType.getJaxbMapping(), jaxbType.getJaxbModel());
    t.setUnwrapped(true);
    Parameter parameter = createParameter(elementName.getLocalPart(), t, block);
    parameter.setEmbedded(true);
    return parameter;
}
Also used : JavaType(com.sun.tools.ws.processor.model.java.JavaType) QName(javax.xml.namespace.QName) JavaSimpleType(com.sun.tools.ws.processor.model.java.JavaSimpleType) Parameter(com.sun.tools.ws.processor.model.Parameter) JavaStructureMember(com.sun.tools.ws.processor.model.java.JavaStructureMember)

Example 4 with JavaSimpleType

use of com.sun.tools.ws.processor.model.java.JavaSimpleType in project metro-jax-ws by eclipse-ee4j.

the class AsyncOperation method getCallBackType.

public JavaType getCallBackType() {
    if (_asyncOpType.equals(AsyncOperationType.CALLBACK)) {
        JCodeModel cm = _responseBean.getJavaType().getType().getType().owner();
        JClass cb = cm.ref(jakarta.xml.ws.AsyncHandler.class).narrow(_responseBean.getJavaType().getType().getType().boxify());
        return new JavaSimpleType(new JAXBTypeAndAnnotation(cb));
    }
    return null;
}
Also used : JAXBTypeAndAnnotation(com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation) JClass(com.sun.codemodel.JClass) JavaSimpleType(com.sun.tools.ws.processor.model.java.JavaSimpleType) JCodeModel(com.sun.codemodel.JCodeModel)

Aggregations

JavaSimpleType (com.sun.tools.ws.processor.model.java.JavaSimpleType)4 JavaType (com.sun.tools.ws.processor.model.java.JavaType)3 Parameter (com.sun.tools.ws.processor.model.Parameter)2 QName (javax.xml.namespace.QName)2 JClass (com.sun.codemodel.JClass)1 JCodeModel (com.sun.codemodel.JCodeModel)1 JavaStructureMember (com.sun.tools.ws.processor.model.java.JavaStructureMember)1 JAXBMapping (com.sun.tools.ws.processor.model.jaxb.JAXBMapping)1 JAXBType (com.sun.tools.ws.processor.model.jaxb.JAXBType)1 JAXBTypeAndAnnotation (com.sun.tools.ws.processor.model.jaxb.JAXBTypeAndAnnotation)1 AbortException (com.sun.tools.ws.wscompile.AbortException)1 MessagePart (com.sun.tools.ws.wsdl.document.MessagePart)1 TypeAndAnnotation (com.sun.tools.xjc.api.TypeAndAnnotation)1 ArrayList (java.util.ArrayList)1