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);
}
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;
}
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;
}
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;
}
Aggregations