private boolean needToRender(MessagePartInfo part) { if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); return element.isNillable() && element.getMinOccurs() > 0; } return false; }
private boolean needToRender(MessagePartInfo part) { if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); return element.isNillable() && element.getMinOccurs() > 0; } return false; }
private boolean isXSDPrimitive(MessagePartInfo part) { String xsdNs = "http://www.w3.org/2001/XMLSchema"; QName tn = null; if (part.isElement()) { tn = ((XmlSchemaElement)part.getXmlSchema()).getSchemaTypeName(); } else { tn = part.getTypeQName(); } if (tn != null && tn.getNamespaceURI().equals(xsdNs)) { return true; } // TODO: introspect xml schema object to see if the <xsd:element> is a simpleType // restriction return false; }
public static List<String> getOperationInputPartNames(OperationInfo operation) { List<String> names = new ArrayList<>(); List<MessagePartInfo> parts = operation.getInput().getMessageParts(); if (parts == null || parts.isEmpty()) { return names; } for (MessagePartInfo part : parts) { XmlSchemaAnnotated schema = part.getXmlSchema(); if (schema instanceof XmlSchemaElement && ((XmlSchemaElement)schema).getSchemaType() instanceof XmlSchemaComplexType) { XmlSchemaElement element = (XmlSchemaElement)schema; XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType(); XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle(); if (seq == null || seq.getItems() == null) { return names; } for (int i = 0; i < seq.getItems().size(); i++) { XmlSchemaElement elChild = (XmlSchemaElement)seq.getItems().get(i); names.add(elChild.getName()); } } else { names.add(part.getConcreteName().getLocalPart()); } } return names; }
public static List<String> getOperationInputPartNames(OperationInfo operation) { List<String> names = new ArrayList<>(); List<MessagePartInfo> parts = operation.getInput().getMessageParts(); if (parts == null || parts.isEmpty()) { return names; } for (MessagePartInfo part : parts) { XmlSchemaAnnotated schema = part.getXmlSchema(); if (schema instanceof XmlSchemaElement && ((XmlSchemaElement)schema).getSchemaType() instanceof XmlSchemaComplexType) { XmlSchemaElement element = (XmlSchemaElement)schema; XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType(); XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle(); if (seq == null || seq.getItems() == null) { return names; } for (int i = 0; i < seq.getItems().size(); i++) { XmlSchemaElement elChild = (XmlSchemaElement)seq.getItems().get(i); names.add(elChild.getName()); } } else { names.add(part.getConcreteName().getLocalPart()); } } return names; }
while (part != null && !rname.equals(part.getConcreteName())) { if (part.getXmlSchema() instanceof XmlSchemaElement) {
while (part != null && !rname.equals(part.getConcreteName())) { if (part.getXmlSchema() instanceof XmlSchemaElement) {
public static List<String> getOperationInputPartNames(OperationInfo operation) { List<String> names = new ArrayList<String>(); List<MessagePartInfo> parts = operation.getInput().getMessageParts(); if (parts == null || parts.size() == 0) { return names; } for (MessagePartInfo part : parts) { XmlSchemaAnnotated schema = part.getXmlSchema(); if (schema instanceof XmlSchemaElement && ((XmlSchemaElement)schema).getSchemaType() instanceof XmlSchemaComplexType) { XmlSchemaElement element = (XmlSchemaElement)schema; XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType(); XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle(); if (seq == null || seq.getItems() == null) { return names; } for (int i = 0; i < seq.getItems().size(); i++) { XmlSchemaElement elChild = (XmlSchemaElement)seq.getItems().get(i); names.add(elChild.getName()); } } else { names.add(part.getConcreteName().getLocalPart()); } } return names; }
private void processReturn(JavaMethod method, MessagePartInfo part) { String name = part == null ? "return" : part.getName().getLocalPart(); String type = part == null ? "void" : ProcessorUtil.resolvePartType(part, context); String namespace = part == null ? null : ProcessorUtil.resolvePartNamespace(part); JavaReturn returnType = new JavaReturn(name, type, namespace); if (part != null) { returnType.setDefaultValueWriter(ProcessorUtil.getDefaultValueWriter(part, context)); } returnType.setQName(ProcessorUtil.getElementName(part)); returnType.setStyle(JavaType.Style.OUT); if (namespace != null && type != null && !"void".equals(type)) { returnType.setClassName(ProcessorUtil.getFullClzName(part, context, false)); } if (part != null && part.getXmlSchema() instanceof XmlSchemaSimpleType) { processXmlSchemaSimpleType((XmlSchemaSimpleType)part.getXmlSchema(), method, part); } else if (part != null && part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); if (element.getSchemaType() instanceof XmlSchemaSimpleType) { processXmlSchemaSimpleType((XmlSchemaSimpleType)element.getSchemaType(), method, part); } } method.setReturn(returnType); }
public static List<String> getOperationInputPartNames(OperationInfo operation) { List<String> names = new ArrayList<String>(); List<MessagePartInfo> parts = operation.getInput().getMessageParts(); if (parts == null || parts.size() == 0) { return names; } for (MessagePartInfo part : parts) { XmlSchemaAnnotated schema = part.getXmlSchema(); if (schema instanceof XmlSchemaElement && ((XmlSchemaElement)schema).getSchemaType() instanceof XmlSchemaComplexType) { XmlSchemaElement element = (XmlSchemaElement)schema; XmlSchemaComplexType cplxType = (XmlSchemaComplexType)element.getSchemaType(); XmlSchemaSequence seq = (XmlSchemaSequence)cplxType.getParticle(); if (seq == null || seq.getItems() == null) { return names; } for (int i = 0; i < seq.getItems().size(); i++) { XmlSchemaElement elChild = (XmlSchemaElement)seq.getItems().get(i); names.add(elChild.getName()); } } else { names.add(part.getConcreteName().getLocalPart()); } } return names; }
part.getXmlSchema(), schemas, params); } else { doc = IriDecoderHelper.buildDocument(part.getXmlSchema(), schemas, params);
if (part.getXmlSchema() instanceof XmlSchemaSimpleType) { processXmlSchemaSimpleType((XmlSchemaSimpleType)part.getXmlSchema(), jm, parameter, part); } else if (part.getXmlSchema() instanceof XmlSchemaElement) { XmlSchemaElement element = (XmlSchemaElement)part.getXmlSchema(); if (element.getSchemaType() instanceof XmlSchemaSimpleType) { processXmlSchemaSimpleType((XmlSchemaSimpleType)element.getSchemaType(), jm, parameter, part);
public void checkForExistence(MessagePartInfo part) { QName qn = part.getElementQName(); if (qn != null) { XmlSchemaElement el = schemas.getElementByQName(qn); if (el == null) { Class<?> clazz = part.getTypeClass(); if (clazz == null) { return; } boolean isFromWrapper = part.getMessageInfo().getOperation().isUnwrapped(); if (isFromWrapper && clazz.isArray() && !Byte.TYPE.equals(clazz.getComponentType())) { clazz = clazz.getComponentType(); } JAXBBeanInfo beanInfo = getBeanInfo(clazz); if (beanInfo == null) { if (Exception.class.isAssignableFrom(clazz)) { QName name = (QName)part.getMessageInfo().getProperty("elementName"); part.setElementQName(name); buildExceptionType(part, clazz); } return; } QName typeName = getTypeName(beanInfo); createBridgeXsElement(part, qn, typeName); } else if (part.getXmlSchema() == null) { part.setXmlSchema(el); } } }
protected void initializeMessageTypes(ServiceInfo s, AbstractMessageContainer container, int partType) { if (container == null) { return; } SchemaCollection col = s.getXmlSchemaCollection(); for (MessagePartInfo part : container.getMessageParts()) { if (part.getXmlSchema() == null) { if (part.isElement()) { XmlSchemaAnnotated tp = col.getElementByQName(part.getElementQName()); part.setXmlSchema(tp); } else { XmlSchemaAnnotated tp = col.getTypeByQName(part.getTypeQName()); part.setXmlSchema(tp); } } } }
QName diagnosticName = mpi.getName(); if (mpi.isElement()) { element = (XmlSchemaElement)mpi.getXmlSchema(); if (element == null) { element = XmlSchemaUtils.findElementByRefName(xmlSchemaCollection, mpi.getElementQName(), type = (XmlSchemaType)mpi.getXmlSchema(); if (type == null) { type = xmlSchemaCollection.getTypeByQName(mpi.getTypeQName());
protected void initializeMessageTypes(ServiceInfo s, AbstractMessageContainer container, int partType) { if (container == null) { return; } SchemaCollection col = s.getXmlSchemaCollection(); for (MessagePartInfo part : container.getMessageParts()) { if (part.getXmlSchema() == null) { if (part.isElement()) { XmlSchemaAnnotated tp = col.getElementByQName(part.getElementQName()); part.setXmlSchema(tp); } else { XmlSchemaAnnotated tp = col.getTypeByQName(part.getTypeQName()); part.setXmlSchema(tp); } } } }
protected void checkForElement(ServiceInfo serviceInfo, MessagePartInfo mpi) { SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(), getQualifyWrapperSchema()); XmlSchemaElement e = si.getSchema().getElementByName(mpi.getElementQName().getLocalPart()); if (e != null) { mpi.setXmlSchema(e); return; } XmlSchema schema = si.getSchema(); si.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(mpi.getElementQName().getLocalPart()); el.setNillable(true); XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema(); if (tp == null) { throw new ServiceConstructionException(new Message("INTRACTABLE_PART", LOG, mpi.getName(), mpi.getMessageInfo().getName())); } el.setSchemaTypeName(tp.getQName()); mpi.setXmlSchema(el); }
protected void checkForElement(ServiceInfo serviceInfo, MessagePartInfo mpi) { SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(), getQualifyWrapperSchema()); XmlSchemaElement e = si.getSchema().getElementByName(mpi.getElementQName().getLocalPart()); if (e != null) { mpi.setXmlSchema(e); return; } XmlSchema schema = si.getSchema(); si.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(mpi.getElementQName().getLocalPart()); el.setNillable(true); XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema(); if (tp == null) { throw new ServiceConstructionException(new Message("INTRACTABLE_PART", LOG, mpi.getName(), mpi.getMessageInfo().getName())); } el.setSchemaTypeName(tp.getQName()); mpi.setXmlSchema(el); }
protected void checkForElement(ServiceInfo serviceInfo, MessagePartInfo mpi) { SchemaInfo si = getOrCreateSchema(serviceInfo, mpi.getElementQName().getNamespaceURI(), getQualifyWrapperSchema()); XmlSchemaElement e = si.getSchema().getElementByName(mpi.getElementQName().getLocalPart()); if (e != null) { mpi.setXmlSchema(e); return; } XmlSchema schema = si.getSchema(); si.setElement(null); //cached element is now invalid XmlSchemaElement el = new XmlSchemaElement(schema, true); el.setName(mpi.getElementQName().getLocalPart()); el.setNillable(true); XmlSchemaType tp = (XmlSchemaType)mpi.getXmlSchema(); if (tp == null) { throw new ServiceConstructionException(new Message("INTRACTABLE_PART", LOG, mpi.getName(), mpi.getMessageInfo().getName())); } el.setSchemaTypeName(tp.getQName()); mpi.setXmlSchema(el); }
|| !(part.getXmlSchema() instanceof XmlSchemaElement)) {