Java Code Examples for com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext#push()
The following examples show how to use
com.sun.tools.internal.ws.api.wsdl.TWSDLParserContext#push() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HTTPExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public boolean handleBindingExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_BINDING)) { context.push(); context.registerNamespaces(e); HTTPBinding binding = new HTTPBinding(context.getLocation(e)); String verb = Util.getRequiredAttribute(e, Constants.ATTR_VERB); binding.setVerb(verb); parent.addExtension(binding); context.pop(); // context.fireDoneParsingEntity(HTTPConstants.QNAME_BINDING, binding); return true; } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 2
Source File: MIMEExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
protected MIMEContent parseMIMEContent(TWSDLParserContext context, Element e) { context.push(); context.registerNamespaces(e); MIMEContent content = new MIMEContent(context.getLocation(e)); String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART); if (part != null) { content.setPart(part); } String type = XmlUtil.getAttributeOrNull(e, Constants.ATTR_TYPE); if (type != null) { content.setType(type); } context.pop(); // context.fireDoneParsingEntity(MIMEConstants.QNAME_CONTENT, content); return content; }
Example 3
Source File: HTTPExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public boolean handlePortExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, HTTPConstants.QNAME_ADDRESS)) { context.push(); context.registerNamespaces(e); HTTPAddress address = new HTTPAddress(context.getLocation(e)); String location = Util.getRequiredAttribute(e, Constants.ATTR_LOCATION); address.setLocation(location); parent.addExtension(address); context.pop(); // context.fireDoneParsingEntity(HTTPConstants.QNAME_ADDRESS, address); return true; } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 4
Source File: JAXWSBindingExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) { context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ parseWrapperStyle(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ parseAsynMapping(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){ parseMethod(context, jaxwsBinding, e2); if((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)){ parent.setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc())); } }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)){ parseParameter(context, jaxwsBinding, e2); }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }
Example 5
Source File: MIMEExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
protected MIMEXml parseMIMEXml(TWSDLParserContext context, Element e) { context.push(); context.registerNamespaces(e); MIMEXml mimeXml = new MIMEXml(context.getLocation(e)); String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART); if (part != null) { mimeXml.setPart(part); } context.pop(); // context.fireDoneParsingEntity(MIMEConstants.QNAME_MIME_XML, mimeXml); return mimeXml; }
Example 6
Source File: JAXWSBindingExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override public boolean handleServiceExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ parseClass(context, jaxwsBinding, e2); if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ ((Service)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); } }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 7
Source File: SOAPExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
@Override public boolean handlePortExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, getAddressQName())) { context.push(); context.registerNamespaces(e); SOAPAddress address = new SOAPAddress(context.getLocation(e)); String location = Util.getRequiredAttribute(e, Constants.ATTR_LOCATION); address.setLocation(location); parent.addExtension(address); context.pop(); // context.fireDoneParsingEntity(getAddressQName(), address); return true; } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }
Example 8
Source File: MIMEExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
protected MIMEXml parseMIMEXml(TWSDLParserContext context, Element e) { context.push(); context.registerNamespaces(e); MIMEXml mimeXml = new MIMEXml(context.getLocation(e)); String part = XmlUtil.getAttributeOrNull(e, Constants.ATTR_PART); if (part != null) { mimeXml.setPart(part); } context.pop(); // context.fireDoneParsingEntity(MIMEConstants.QNAME_MIME_XML, mimeXml); return mimeXml; }
Example 9
Source File: JAXWSBindingExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override public boolean handleFaultExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)){ parseClass(context, jaxwsBinding, e2); if((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null)){ ((Fault)parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); } }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 10
Source File: JAXWSBindingExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private boolean handlePortTypeOperation(TWSDLParserContext context, Operation parent, Element e) { context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)){ parseWrapperStyle(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)){ parseAsynMapping(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){ parseMethod(context, jaxwsBinding, e2); if((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)){ parent.setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc())); } }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)){ parseParameter(context, jaxwsBinding, e2); }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }
Example 11
Source File: JAXWSBindingExtensionHandler.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); // }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ parseMimeContent(context, jaxwsBinding, e2); }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 12
Source File: JAXWSBindingExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
@Override public boolean handleBindingExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); // }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ parseMimeContent(context, jaxwsBinding, e2); }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 13
Source File: JAXWSBindingExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
@Override public boolean handlePortTypeExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_WRAPPER_STYLE)) { parseWrapperStyle(context, jaxwsBinding, e2); } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ASYNC_MAPPING)) { parseAsynMapping(context, jaxwsBinding, e2); } else if (XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.CLASS)) { parseClass(context, jaxwsBinding, e2); if ((jaxwsBinding.getClassName() != null) && (jaxwsBinding.getClassName().getJavaDoc() != null) && (parent instanceof PortType)) { ((PortType) parent).setDocumentation(new Documentation(jaxwsBinding.getClassName().getJavaDoc())); } } else { Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 14
Source File: JAXWSBindingExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
private boolean handleBindingOperation(TWSDLParserContext context, BindingOperation operation, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } // if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_ADDITIONAL_SOAPHEADER_MAPPING)){ // parseAdditionalSOAPHeaderMapping(context, jaxwsBinding, e2); // }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.ENABLE_MIME_CONTENT)){ parseMimeContent(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PARAMETER)){ parseParameter(context, jaxwsBinding, e2); }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } operation.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 15
Source File: JAXWSBindingExtensionHandler.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
@Override public boolean handlePortExtension(TWSDLParserContext context, TWSDLExtensible parent, Element e) { if(XmlUtil.matchesTagNS(e, JAXWSBindingsConstants.JAXWS_BINDINGS)){ context.push(); context.registerNamespaces(e); JAXWSBinding jaxwsBinding = new JAXWSBinding(context.getLocation(e)); for(Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();){ Element e2 = Util.nextElement(iter); if (e2 == null) { break; } if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.PROVIDER)){ parseProvider(context, jaxwsBinding, e2); }else if(XmlUtil.matchesTagNS(e2, JAXWSBindingsConstants.METHOD)){ parseMethod(context, jaxwsBinding, e2); if((jaxwsBinding.getMethodName() != null) && (jaxwsBinding.getMethodName().getJavaDoc() != null)){ ((Port)parent).setDocumentation(new Documentation(jaxwsBinding.getMethodName().getJavaDoc())); } }else{ Util.fail( "parsing.invalidExtensionElement", e2.getTagName(), e2.getNamespaceURI()); return false; } } parent.addExtension(jaxwsBinding); context.pop(); // context.fireDoneParsingEntity( // JAXWSBindingsConstants.JAXWS_BINDINGS, // jaxwsBinding); return true; }else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; } }
Example 16
Source File: SOAPExtensionHandler.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public boolean handleFaultExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, getFaultQName())) { context.push(); context.registerNamespaces(e); SOAPFault fault = new SOAPFault(context.getLocation(e)); String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME); if (name != null) { fault.setName(name); } String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE); if (use != null) { if (use.equals(Constants.ATTRVALUE_LITERAL)) { fault.setUse(SOAPUse.LITERAL); } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { fault.setUse(SOAPUse.ENCODED); } else { Util.fail( "parsing.invalidAttributeValue", Constants.ATTR_USE, use); } } String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE); if (namespace != null) { fault.setNamespace(namespace); } String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE); if (encodingStyle != null) { fault.setEncodingStyle(encodingStyle); } parent.addExtension(fault); context.pop(); // context.fireDoneParsingEntity(getFaultQName(), fault); return true; } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) { // although SOAP spec doesn't define meaning of this extension; it is allowed // to be here, so we have to accept it, not fail (bug 13576977) return handleHeaderElement(parent, e, (TWSDLParserContextImpl) context); } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }
Example 17
Source File: SOAPExtensionHandler.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public boolean handleFaultExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, getFaultQName())) { context.push(); context.registerNamespaces(e); SOAPFault fault = new SOAPFault(context.getLocation(e)); String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME); if (name != null) { fault.setName(name); } String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE); if (use != null) { if (use.equals(Constants.ATTRVALUE_LITERAL)) { fault.setUse(SOAPUse.LITERAL); } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { fault.setUse(SOAPUse.ENCODED); } else { Util.fail( "parsing.invalidAttributeValue", Constants.ATTR_USE, use); } } String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE); if (namespace != null) { fault.setNamespace(namespace); } String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE); if (encodingStyle != null) { fault.setEncodingStyle(encodingStyle); } parent.addExtension(fault); context.pop(); // context.fireDoneParsingEntity(getFaultQName(), fault); return true; } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) { // although SOAP spec doesn't define meaning of this extension; it is allowed // to be here, so we have to accept it, not fail (bug 13576977) return handleHeaderElement(parent, e, (TWSDLParserContextImpl) context); } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }
Example 18
Source File: SOAPExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public boolean handleFaultExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, getFaultQName())) { context.push(); context.registerNamespaces(e); SOAPFault fault = new SOAPFault(context.getLocation(e)); String name = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAME); if (name != null) { fault.setName(name); } String use = XmlUtil.getAttributeOrNull(e, Constants.ATTR_USE); if (use != null) { if (use.equals(Constants.ATTRVALUE_LITERAL)) { fault.setUse(SOAPUse.LITERAL); } else if (use.equals(Constants.ATTRVALUE_ENCODED)) { fault.setUse(SOAPUse.ENCODED); } else { Util.fail( "parsing.invalidAttributeValue", Constants.ATTR_USE, use); } } String namespace = XmlUtil.getAttributeOrNull(e, Constants.ATTR_NAMESPACE); if (namespace != null) { fault.setNamespace(namespace); } String encodingStyle = XmlUtil.getAttributeOrNull(e, Constants.ATTR_ENCODING_STYLE); if (encodingStyle != null) { fault.setEncodingStyle(encodingStyle); } parent.addExtension(fault); context.pop(); // context.fireDoneParsingEntity(getFaultQName(), fault); return true; } else if (XmlUtil.matchesTagNS(e, getHeaderQName())) { // although SOAP spec doesn't define meaning of this extension; it is allowed // to be here, so we have to accept it, not fail (bug 13576977) return handleHeaderElement(parent, e, (TWSDLParserContextImpl) context); } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }
Example 19
Source File: SOAPExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
public boolean handleOperationExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, getOperationQName())) { context.push(); context.registerNamespaces(e); SOAPOperation operation = new SOAPOperation(context.getLocation(e)); String soapAction = XmlUtil.getAttributeOrNull(e, Constants.ATTR_SOAP_ACTION); if (soapAction != null) { operation.setSOAPAction(soapAction); } String style = XmlUtil.getAttributeOrNull(e, Constants.ATTR_STYLE); if (style != null) { if (style.equals(Constants.ATTRVALUE_RPC)) { operation.setStyle(SOAPStyle.RPC); } else if (style.equals(Constants.ATTRVALUE_DOCUMENT)) { operation.setStyle(SOAPStyle.DOCUMENT); } else { Util.fail( "parsing.invalidAttributeValue", Constants.ATTR_STYLE, style); } } parent.addExtension(operation); context.pop(); // context.fireDoneParsingEntity( // getOperationQName(), // operation); return true; } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }
Example 20
Source File: MIMEExtensionHandler.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
protected boolean handleInputOutputExtension( TWSDLParserContext context, TWSDLExtensible parent, Element e) { if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_MULTIPART_RELATED)) { context.push(); context.registerNamespaces(e); MIMEMultipartRelated mpr = new MIMEMultipartRelated(context.getLocation(e)); for (Iterator iter = XmlUtil.getAllChildren(e); iter.hasNext();) { Element e2 = Util.nextElement(iter); if (e2 == null) break; if (XmlUtil.matchesTagNS(e2, MIMEConstants.QNAME_PART)) { context.push(); context.registerNamespaces(e2); MIMEPart part = new MIMEPart(context.getLocation(e2)); String name = XmlUtil.getAttributeOrNull(e2, Constants.ATTR_NAME); if (name != null) { part.setName(name); } for (Iterator iter2 = XmlUtil.getAllChildren(e2); iter2.hasNext(); ) { Element e3 = Util.nextElement(iter2); if (e3 == null) break; AbstractExtensionHandler h = getExtensionHandlers().get(e3.getNamespaceURI()); boolean handled = false; if (h != null) { handled = h.doHandleExtension(context, part, e3); } if (!handled) { String required = XmlUtil.getAttributeNSOrNull( e3, Constants.ATTR_REQUIRED, Constants.NS_WSDL); if (required != null && required.equals(Constants.TRUE)) { Util.fail( "parsing.requiredExtensibilityElement", e3.getTagName(), e3.getNamespaceURI()); } else { // context.fireIgnoringExtension( // new QName( // e3.getNamespaceURI(), // e3.getLocalName()), // part.getElementName()); } } } mpr.add(part); context.pop(); // context.fireDoneParsingEntity( // MIMEConstants.QNAME_PART, // part); } else { Util.fail( "parsing.invalidElement", e2.getTagName(), e2.getNamespaceURI()); } } parent.addExtension(mpr); context.pop(); // context.fireDoneParsingEntity( // MIMEConstants.QNAME_MULTIPART_RELATED, // mpr); return true; } else if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_CONTENT)) { MIMEContent content = parseMIMEContent(context, e); parent.addExtension(content); return true; } else if (XmlUtil.matchesTagNS(e, MIMEConstants.QNAME_MIME_XML)) { MIMEXml mimeXml = parseMIMEXml(context, e); parent.addExtension(mimeXml); return true; } else { Util.fail( "parsing.invalidExtensionElement", e.getTagName(), e.getNamespaceURI()); return false; // keep compiler happy } }