Search in sources :

Example 1 with JavaType

use of com.sun.tools.ws.processor.model.java.JavaType 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 JavaType

use of com.sun.tools.ws.processor.model.java.JavaType 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 JavaType

use of com.sun.tools.ws.processor.model.java.JavaType 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)

Aggregations

JavaSimpleType (com.sun.tools.ws.processor.model.java.JavaSimpleType)3 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 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 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