private MessagePartInfo getFaultMessagePart(QName qname, OperationInfo op) { for (FaultInfo faultInfo : op.getFaults()) { for (MessagePartInfo mpi : faultInfo.getMessageParts()) { String ns = null; if (mpi.isElement()) { ns = mpi.getElementQName().getNamespaceURI(); } else { ns = mpi.getTypeQName().getNamespaceURI(); } if (qname.getLocalPart().equals(mpi.getConcreteName().getLocalPart()) && qname.getNamespaceURI().equals(ns)) { return mpi; } } } return null; }
protected final boolean honorJAXBAnnotations(MessagePartInfo part) { if (part == null) { return false; } if (!part.isElement()) { //RPC-Lit always needs to look for these return true; } //certain cases that use XmlJavaTypeAdapters will require this and the //JAXBSchemaInitializer will set this. Boolean b = (Boolean)part.getProperty("honor.jaxb.annotations"); return b == null ? false : b; }
protected MessagePartInfo getFaultMessagePartInfo(OperationInfo opInfo, QName faultName) { Iterator<FaultInfo> faults = opInfo.getFaults().iterator(); while (faults.hasNext()) { FaultInfo fault = faults.next(); MessagePartInfo partInfo = fault.getMessageParts().get(0); if (partInfo.isElement() && partInfo.getElementQName().getLocalPart().equals(faultName.getLocalPart())) { return partInfo; } else if (partInfo.getTypeQName().getLocalPart().equals(faultName.getLocalPart())) { return partInfo; } } return null; }
protected String getWrappedParamNamespace(MessageInfo msgInfo) { MessagePartInfo part = msgInfo.getMessageParts().get(0); if (part.isElement()) { return part.getElementQName().getNamespaceURI(); } return part.getName().getNamespaceURI(); } }
protected FaultInfo getFaultInfo(OperationInfo opInfo, QName faultName) { Iterator<FaultInfo> faults = opInfo.getFaults().iterator(); while (faults.hasNext()) { FaultInfo fault = faults.next(); MessagePartInfo partInfo = fault.getMessageParts().get(0); if (partInfo.isElement() && partInfo.getElementQName().getLocalPart().equals(faultName.getLocalPart())) { return fault; } else if (partInfo.getTypeQName().getLocalPart().equals(faultName.getLocalPart())) { return fault; } } return null; }
protected String getWrappedParamNamespace(MessageInfo msgInfo) { MessagePartInfo part = msgInfo.getMessageParts().get(0); if (part.isElement()) { return part.getElementQName().getNamespaceURI(); } return part.getName().getNamespaceURI(); }
protected QName getMessageParamQName(MessageInfo msgInfo, String paramName, int index) { QName paramQName = null; MessagePartInfo part = msgInfo.getMessageParts().get(index); if (part != null && part.isElement()) { paramQName = part.getElementQName(); } else if (part != null) { paramQName = part.getName(); } return paramQName; }
protected QName getMessageParamQName(MessageInfo msgInfo, String paramName, int index) { QName paramQName = null; MessagePartInfo part = msgInfo.getMessageParts().get(index); if (part != null && part.isElement()) { paramQName = part.getElementQName(); } else if (part != null) { paramQName = part.getName(); } return paramQName; }
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 SchemaInfo getSchema(ServiceInfo serviceInfo, MessagePartInfo messagePartInfo) { SchemaInfo schemaInfo = null; String tns = null; if (messagePartInfo.isElement()) { tns = messagePartInfo.getElementQName().getNamespaceURI(); } else { tns = messagePartInfo.getTypeQName().getNamespaceURI(); } for (SchemaInfo schema : serviceInfo.getSchemas()) { if (tns.equals(schema.getNamespaceURI())) { schemaInfo = schema; } } return schemaInfo; }
public static SchemaInfo getSchema(ServiceInfo serviceInfo, MessagePartInfo messagePartInfo) { SchemaInfo schemaInfo = null; String tns = null; if (messagePartInfo.isElement()) { tns = messagePartInfo.getElementQName().getNamespaceURI(); } else { tns = messagePartInfo.getTypeQName().getNamespaceURI(); } for (SchemaInfo schema : serviceInfo.getSchemas()) { if (tns.equals(schema.getNamespaceURI())) { schemaInfo = schema; } } return schemaInfo; }
public static SchemaInfo getSchema(ServiceInfo serviceInfo, MessagePartInfo messagePartInfo) { SchemaInfo schemaInfo = null; String tns = null; if (messagePartInfo.isElement()) { tns = messagePartInfo.getElementQName().getNamespaceURI(); } else { tns = messagePartInfo.getTypeQName().getNamespaceURI(); } for (SchemaInfo schema : serviceInfo.getSchemas()) { if (tns.equals(schema.getNamespaceURI())) { schemaInfo = schema; } } return schemaInfo; }
public static SchemaInfo getSchema(ServiceInfo serviceInfo, MessagePartInfo messagePartInfo) { SchemaInfo schemaInfo = null; String tns = null; if (messagePartInfo.isElement()) { tns = messagePartInfo.getElementQName().getNamespaceURI(); } else { tns = messagePartInfo.getTypeQName().getNamespaceURI(); } for (SchemaInfo schema : serviceInfo.getSchemas()) { if (tns.equals(schema.getNamespaceURI())) { schemaInfo = schema; } } return schemaInfo; }
private void adjustConcreteNames(MessageInfo mi) { if (mi != null) { for (MessagePartInfo mpi : mi.getMessageParts()) { if (!mpi.isElement()) { //if it's not an element, we need to make it one mpi.setConcreteName(mpi.getName()); } } } } }
private void adjustConcreteNames(MessageInfo mi) { if (mi != null) { for (MessagePartInfo mpi : mi.getMessageParts()) { if (!mpi.isElement()) { //if it's not an element, we need to make it one mpi.setConcreteName(mpi.getName()); } } } } }
private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod jm, JavaParameter parameter, MessagePartInfo part) { if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList && (!part.isElement() || !jm.isWrapperStyle())) { parameter.annotate(new XmlListAnotator(jm.getInterface())); } if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName()) && (!part.isElement() || !jm.isWrapperStyle())) { parameter.annotate(new XmlJavaTypeAdapterAnnotator(jm.getInterface(), HexBinaryAdapter.class)); } }
private static void processXmlSchemaSimpleType(XmlSchemaSimpleType xmlSchema, JavaMethod method, MessagePartInfo part) { if (xmlSchema.getContent() instanceof XmlSchemaSimpleTypeList && (!part.isElement() || !method.isWrapperStyle())) { method.annotate(new XmlListAnotator(method.getInterface())); } if (Constants.XSD_HEXBIN.equals(xmlSchema.getQName()) && (!part.isElement() || !method.isWrapperStyle())) { method.annotate(new XmlJavaTypeAdapterAnnotator(method.getInterface(), HexBinaryAdapter.class)); } }
public static DefaultValueWriter getDefaultValueWriter(MessagePartInfo part, ToolContext context) { DataBindingProfile dataBinding = context.get(DataBindingProfile.class); if (part.isElement()) { return dataBinding.createDefaultValueWriter(getElementName(part), true); } return dataBinding.createDefaultValueWriter(part.getTypeQName(), false); } public static DefaultValueWriter getDefaultValueWriterForWrappedElement(MessagePartInfo part,
public static String getType(MessagePartInfo part, ToolContext context, boolean fullname) { String type = ""; DataBindingProfile dataBinding = context.get(DataBindingProfile.class); if (part.isElement()) { type = dataBinding.getType(getElementName(part), true); } else { type = dataBinding.getType(part.getTypeQName(), false); } if (type == null) { type = resolvePartType(part); } return type; } public static DefaultValueWriter getDefaultValueWriter(MessagePartInfo part,
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); } } } }