You are viewing a plain text version of this content. The canonical link for it is here.
Posted to woden-dev@ws.apache.org by jk...@apache.org on 2005/12/05 14:41:04 UTC
svn commit: r354070 - in /incubator/woden/java/src/org/apache/woden:
internal/wsdl20/extensions/ wsdl20/extensions/
Author: jkaputin
Date: Mon Dec 5 05:40:47 2005
New Revision: 354070
URL: http://svn.apache.org/viewcvs?rev=354070&view=rev
Log:
Added initial extension mechanism to support extension
attributes and elements. More still to do on ext elements.
Added:
incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java
Modified:
incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java
Added: incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java (added)
+++ incubator/woden/java/src/org/apache/woden/internal/wsdl20/extensions/PopulatedExtensionRegistry.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,354 @@
+/**
+ * Copyright 2005 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.internal.wsdl20.extensions;
+
+import org.apache.woden.internal.wsdl20.extensions.soap.SOAPConstants;
+import org.apache.woden.internal.xml.QNameAttrImpl;
+import org.apache.woden.internal.xml.StringAttrImpl;
+import org.apache.woden.internal.xml.URIAttrImpl;
+import org.apache.woden.wsdl20.extensions.ExtensionRegistry;
+import org.apache.woden.wsdl20.xml.BindingElement;
+import org.apache.woden.wsdl20.xml.BindingFaultElement;
+import org.apache.woden.wsdl20.xml.BindingOperationElement;
+
+/**
+ * This class extends ExtensionRegistry and pre-registers
+ * serializers/deserializers for the SOAP, HTTP and MIME
+ * extensions. Java impl types are also registered for all
+ * the SOAP and HTTP extensions defined in the WSDL 2.0 Spec.
+ *
+ * This class was copied from WSDL4J and modified for Woden.
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ * @author jkaputin@apache.org
+ */
+public class PopulatedExtensionRegistry extends ExtensionRegistry
+{
+
+ public PopulatedExtensionRegistry()
+ {
+ //SOAP extensions
+
+ registerExtAttributeType(
+ BindingElement.class, SOAPConstants.Q_ATTR_SOAP_VERSION, StringAttrImpl.class);
+
+ registerExtAttributeType(
+ BindingElement.class, SOAPConstants.Q_ATTR_SOAP_PROTOCOL, URIAttrImpl.class);
+
+ registerExtAttributeType(
+ BindingElement.class, SOAPConstants.Q_ATTR_SOAP_MEPDEFAULT, URIAttrImpl.class);
+
+ //TODO Attr impl class to handle union of QName or xs:token
+ registerExtAttributeType(
+ BindingFaultElement.class, SOAPConstants.Q_ATTR_SOAP_CODE, QNameAttrImpl.class);
+
+ //TODO Attr impl class to handle list of QNames
+ //registerExtAttributeType(
+ // BindingFaultElement.class, SOAPConstants.Q_ATTR_SOAP_SUBCODES, QNameListAttrImpl.class);
+
+ registerExtAttributeType(
+ BindingOperationElement.class, SOAPConstants.Q_ATTR_SOAP_MEP, URIAttrImpl.class);
+
+ registerExtAttributeType(
+ BindingOperationElement.class, SOAPConstants.Q_ATTR_SOAP_ACTION, URIAttrImpl.class);
+
+
+ /* TODO modify this wsdl4j code for Woden
+ *
+ SOAPAddressSerializer soapAddressSer = new SOAPAddressSerializer();
+
+ registerSerializer(Port.class,
+ SOAPConstants.Q_ELEM_SOAP_ADDRESS,
+ soapAddressSer);
+ registerDeserializer(Port.class,
+ SOAPConstants.Q_ELEM_SOAP_ADDRESS,
+ soapAddressSer);
+ mapExtensionTypes(Port.class,
+ SOAPConstants.Q_ELEM_SOAP_ADDRESS,
+ SOAPAddressImpl.class);
+
+ SOAPBindingSerializer soapBindingSer = new SOAPBindingSerializer();
+
+ registerSerializer(Binding.class,
+ SOAPConstants.Q_ELEM_SOAP_BINDING,
+ soapBindingSer);
+ registerDeserializer(Binding.class,
+ SOAPConstants.Q_ELEM_SOAP_BINDING,
+ soapBindingSer);
+ mapExtensionTypes(Binding.class,
+ SOAPConstants.Q_ELEM_SOAP_BINDING,
+ SOAPBindingImpl.class);
+
+ SOAPHeaderSerializer soapHeaderSer = new SOAPHeaderSerializer();
+
+ registerSerializer(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ soapHeaderSer);
+ registerDeserializer(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ soapHeaderSer);
+ mapExtensionTypes(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ SOAPHeaderImpl.class);
+ registerSerializer(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ soapHeaderSer);
+ registerDeserializer(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ soapHeaderSer);
+ mapExtensionTypes(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER,
+ SOAPHeaderImpl.class);
+ mapExtensionTypes(SOAPHeader.class,
+ SOAPConstants.Q_ELEM_SOAP_HEADER_FAULT,
+ SOAPHeaderFaultImpl.class);
+
+ SOAPBodySerializer soapBodySer = new SOAPBodySerializer();
+
+ registerSerializer(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ registerDeserializer(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ mapExtensionTypes(BindingInput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ SOAPBodyImpl.class);
+ registerSerializer(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ registerDeserializer(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ mapExtensionTypes(BindingOutput.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ SOAPBodyImpl.class);
+ registerSerializer(MIMEPart.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ registerDeserializer(MIMEPart.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ soapBodySer);
+ mapExtensionTypes(MIMEPart.class,
+ SOAPConstants.Q_ELEM_SOAP_BODY,
+ SOAPBodyImpl.class);
+
+ SOAPFaultSerializer soapFaultSer = new SOAPFaultSerializer();
+
+ registerSerializer(BindingFault.class,
+ SOAPConstants.Q_ELEM_SOAP_FAULT,
+ soapFaultSer);
+ registerDeserializer(BindingFault.class,
+ SOAPConstants.Q_ELEM_SOAP_FAULT,
+ soapFaultSer);
+ mapExtensionTypes(BindingFault.class,
+ SOAPConstants.Q_ELEM_SOAP_FAULT,
+ SOAPFaultImpl.class);
+
+ SOAPOperationSerializer soapOperationSer = new SOAPOperationSerializer();
+
+ registerSerializer(BindingOperation.class,
+ SOAPConstants.Q_ELEM_SOAP_OPERATION,
+ soapOperationSer);
+ registerDeserializer(BindingOperation.class,
+ SOAPConstants.Q_ELEM_SOAP_OPERATION,
+ soapOperationSer);
+ mapExtensionTypes(BindingOperation.class,
+ SOAPConstants.Q_ELEM_SOAP_OPERATION,
+ SOAPOperationImpl.class);
+
+ HTTPAddressSerializer httpAddressSer = new HTTPAddressSerializer();
+
+ registerSerializer(Port.class,
+ HTTPConstants.Q_ELEM_HTTP_ADDRESS,
+ httpAddressSer);
+ registerDeserializer(Port.class,
+ HTTPConstants.Q_ELEM_HTTP_ADDRESS,
+ httpAddressSer);
+ mapExtensionTypes(Port.class,
+ HTTPConstants.Q_ELEM_HTTP_ADDRESS,
+ HTTPAddressImpl.class);
+
+ HTTPOperationSerializer httpOperationSer = new HTTPOperationSerializer();
+
+ registerSerializer(BindingOperation.class,
+ HTTPConstants.Q_ELEM_HTTP_OPERATION,
+ httpOperationSer);
+ registerDeserializer(BindingOperation.class,
+ HTTPConstants.Q_ELEM_HTTP_OPERATION,
+ httpOperationSer);
+ mapExtensionTypes(BindingOperation.class,
+ HTTPConstants.Q_ELEM_HTTP_OPERATION,
+ HTTPOperationImpl.class);
+
+ HTTPBindingSerializer httpBindingSer = new HTTPBindingSerializer();
+
+ registerSerializer(Binding.class,
+ HTTPConstants.Q_ELEM_HTTP_BINDING,
+ httpBindingSer);
+ registerDeserializer(Binding.class,
+ HTTPConstants.Q_ELEM_HTTP_BINDING,
+ httpBindingSer);
+ mapExtensionTypes(Binding.class,
+ HTTPConstants.Q_ELEM_HTTP_BINDING,
+ HTTPBindingImpl.class);
+
+ HTTPUrlEncodedSerializer httpUrlEncodedSer =
+ new HTTPUrlEncodedSerializer();
+
+ registerSerializer(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_ENCODED,
+ httpUrlEncodedSer);
+ registerDeserializer(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_ENCODED,
+ httpUrlEncodedSer);
+ mapExtensionTypes(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_ENCODED,
+ HTTPUrlEncodedImpl.class);
+
+ HTTPUrlReplacementSerializer httpUrlReplacementSer =
+ new HTTPUrlReplacementSerializer();
+
+ registerSerializer(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_REPLACEMENT,
+ httpUrlReplacementSer);
+ registerDeserializer(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_REPLACEMENT,
+ httpUrlReplacementSer);
+ mapExtensionTypes(BindingInput.class,
+ HTTPConstants.Q_ELEM_HTTP_URL_REPLACEMENT,
+ HTTPUrlReplacementImpl.class);
+
+ MIMEContentSerializer mimeContentSer = new MIMEContentSerializer();
+
+ registerSerializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ registerDeserializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ mapExtensionTypes(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ MIMEContentImpl.class);
+ registerSerializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ registerDeserializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ mapExtensionTypes(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ MIMEContentImpl.class);
+ registerSerializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ registerDeserializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ mimeContentSer);
+ mapExtensionTypes(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_CONTENT,
+ MIMEContentImpl.class);
+
+ MIMEMultipartRelatedSerializer mimeMultipartRelatedSer =
+ new MIMEMultipartRelatedSerializer();
+
+ registerSerializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ registerDeserializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ mapExtensionTypes(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ MIMEMultipartRelatedImpl.class);
+ registerSerializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ registerDeserializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ mapExtensionTypes(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ MIMEMultipartRelatedImpl.class);
+ registerSerializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ registerDeserializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ mimeMultipartRelatedSer);
+ mapExtensionTypes(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MULTIPART_RELATED,
+ MIMEMultipartRelatedImpl.class);
+ mapExtensionTypes(MIMEMultipartRelated.class,
+ MIMEConstants.Q_ELEM_MIME_PART,
+ MIMEPartImpl.class);
+
+ MIMEMimeXmlSerializer mimeMimeXmlSer = new MIMEMimeXmlSerializer();
+
+ registerSerializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ registerDeserializer(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ mapExtensionTypes(BindingInput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ MIMEMimeXmlImpl.class);
+ registerSerializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ registerDeserializer(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ mapExtensionTypes(BindingOutput.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ MIMEMimeXmlImpl.class);
+ registerSerializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ registerDeserializer(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ mimeMimeXmlSer);
+ mapExtensionTypes(MIMEPart.class,
+ MIMEConstants.Q_ELEM_MIME_MIME_XML,
+ MIMEMimeXmlImpl.class);
+
+ //Register the schema parser
+
+ mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
+ SchemaImpl.class);
+ registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
+ new SchemaDeserializer());
+ registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_1999,
+ new SchemaSerializer());
+
+ mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
+ SchemaImpl.class);
+ registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
+ new SchemaDeserializer());
+ registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2000,
+ new SchemaSerializer());
+
+ mapExtensionTypes(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
+ SchemaImpl.class);
+ registerDeserializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
+ new SchemaDeserializer());
+ registerSerializer(Types.class, SchemaConstants.Q_ELEM_XSD_2001,
+ new SchemaSerializer());
+ */
+
+ }
+}
\ No newline at end of file
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionDeserializer.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,45 @@
+/*
+ * (c) Copyright IBM Corp 2001, 2005
+ */
+
+package org.apache.woden.wsdl20.extensions;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.w3c.dom.Element;
+
+/**
+ * This interface should be implemented by classes which deserialize
+ * org.w3c.dom.Elements into extension-specific instances of
+ * ExtensibilityElement.
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ */
+public interface ExtensionDeserializer
+{
+ /**
+ * This method deserializes elements into instances of classes
+ * which implement the ExtensibilityElement interface. The
+ * return value should be explicitly cast to the more-specific
+ * implementing type.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility element was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this element was encountered as an immediate child of
+ * a <wsdl:binding> element.
+ * @param elementType the qname of the extensibility element
+ * @param el the extensibility element to deserialize
+ * @param def the definition this extensibility element was
+ * encountered in
+ * @param extReg the ExtensionRegistry to use (if needed again)
+ */
+ public ExtensionElement unmarshall(Class parentType,
+ QName elementType,
+ Element el,
+ DescriptionElement desc,
+ ExtensionRegistry extReg)
+ throws WSDLException;
+}
\ No newline at end of file
Modified: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java?rev=354070&r1=354069&r2=354070&view=diff
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java (original)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionElement.java Mon Dec 5 05:40:47 2005
@@ -16,9 +16,11 @@
package org.apache.woden.wsdl20.extensions;
/**
- * This interface represents any XML element information item that
- * extends a WSDL 2.0 document (i.e. that is not in the WSDL 2.0
- * namespace).
+ * This interface represents WSDL 2.0 extension elements. That is, any XML element
+ * information items that appear as [children] of a WSDL 2.0 element and are not in
+ * the WSDL 2.0 namespace (http://www.w3.org/2005/08/wsdl).
+ *
+ * TODO change this URL if the WSDL 2.0 namespace changes before spec is finalized.
*
* @author jkaputin@apache.org
*/
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionRegistry.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,569 @@
+/**
+ * Copyright 2005 Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.woden.wsdl20.extensions;
+
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.ErrorReporter;
+import org.apache.woden.WSDLException;
+import org.apache.woden.xml.XMLAttr;
+
+/**
+ * This class is used to associate serializers, deserializers, and
+ * Java implementation types with extension elements.
+ * It also associates Java implementation types only with extension attributes,
+ * but not serializers and deserializers.
+ * <p>
+ * This class has been copied from WSDL4J and modified for Woden.
+ *
+ * TODO update method javadocs.
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ * @author jkaputin@apache.org
+ */
+public class ExtensionRegistry
+{
+
+ /**
+ * Creates the extension registry, and sets the defaultSerializer
+ * and defaultDeserializer properties to instances of an
+ * UnknownExtensionSerializer, and an UnknownExtensionDeserializer,
+ * respectively.
+ */
+ public ExtensionRegistry()
+ {
+ setDefaultSerializer(new UnknownExtensionSerializer());
+ setDefaultDeserializer(new UnknownExtensionDeserializer());
+ }
+
+ /*
+ This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
+ and the inner Maps are keyed by (QName)elementType.
+ */
+ protected Map serializerReg = new Hashtable();
+ /*
+ This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
+ and the inner Maps are keyed by (QName)elementType.
+ */
+ protected Map deserializerReg = new Hashtable();
+ /*
+ This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
+ and the inner Maps are keyed by (QName)elementType.
+ */
+ protected Map extElementReg = new Hashtable();
+ protected ExtensionSerializer defaultSer = null;
+ protected ExtensionDeserializer defaultDeser = null;
+ /*
+ This is a Map of Maps. The top-level Map is keyed by (Class)parentType,
+ and the inner Maps are keyed by (QName)attrName.
+ */
+ protected Map extAttributeReg = new Hashtable();
+
+ private ErrorReporter errorReporter = null;
+
+ public void setErrorReporter(ErrorReporter errRpt)
+ {
+ this.errorReporter = errRpt;
+ }
+
+ public ErrorReporter getErrorReporter()
+ {
+ //TODO create a newErrorReporter method on WSDLFactory, then lazy init this field.
+ return this.errorReporter;
+ }
+
+ /**
+ * Set the serializer to be used when none is found for an extensibility
+ * element. Set this to null to have an exception thrown when
+ * unexpected extensibility elements are encountered. Default value is
+ * an instance of UnknownExtensionSerializer.
+ *
+ * @see UnknownExtensionSerializer
+ */
+ public void setDefaultSerializer(ExtensionSerializer defaultSer)
+ {
+ this.defaultSer = defaultSer;
+ }
+
+ /**
+ * Get the serializer to be used when none is found for an extensibility
+ * element. Default value is an instance of UnknownExtensionSerializer.
+ *
+ * @see UnknownExtensionSerializer
+ */
+ public ExtensionSerializer getDefaultSerializer()
+ {
+ return defaultSer;
+ }
+
+ /**
+ * Set the deserializer to be used when none is found for an encountered
+ * element. Set this to null to have an exception thrown when
+ * unexpected extensibility elements are encountered. Default value is
+ * an instance of UnknownExtensionDeserializer.
+ *
+ * @see UnknownExtensionDeserializer
+ */
+ public void setDefaultDeserializer(ExtensionDeserializer defaultDeser)
+ {
+ this.defaultDeser = defaultDeser;
+ }
+
+ /**
+ * Get the deserializer to be used when none is found for an encountered
+ * element. Default value is an instance of UnknownExtensionDeserializer.
+ *
+ * @see UnknownExtensionDeserializer
+ */
+ public ExtensionDeserializer getDefaultDeserializer()
+ {
+ return defaultDeser;
+ }
+
+ /**
+ * Declare that the specified serializer should be used to serialize
+ * all extensibility elements with a qname matching elementType, when
+ * encountered as children of the specified parentType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * definition this extension was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this extensibility element was found in the list of
+ * extensibility elements belonging to a javax.wsdl.Binding.
+ * @param elementType the qname of the extensibility element
+ * @param es the extension serializer to use
+ *
+ * @see #querySerializer(Class, QName)
+ */
+ public void registerSerializer(Class parentType,
+ QName elementType,
+ ExtensionSerializer es)
+ {
+ Map innerSerializerReg = (Map)serializerReg.get(parentType);
+
+ if (innerSerializerReg == null)
+ {
+ innerSerializerReg = new Hashtable();
+
+ serializerReg.put(parentType, innerSerializerReg);
+ }
+
+ innerSerializerReg.put(elementType, es);
+ }
+
+ /**
+ * Declare that the specified deserializer should be used to deserialize
+ * all extensibility elements with a qname matching elementType, when
+ * encountered as immediate children of the element represented by the
+ * specified parentType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility element was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this element was encountered as an immediate child of
+ * a <wsdl:binding> element.
+ * @param elementType the qname of the extensibility element
+ * @param ed the extension deserializer to use
+ *
+ * @see #queryDeserializer(Class, QName)
+ */
+ public void registerDeserializer(Class parentType,
+ QName elementType,
+ ExtensionDeserializer ed)
+ {
+ Map innerDeserializerReg = (Map)deserializerReg.get(parentType);
+
+ if (innerDeserializerReg == null)
+ {
+ innerDeserializerReg = new Hashtable();
+
+ deserializerReg.put(parentType, innerDeserializerReg);
+ }
+
+ innerDeserializerReg.put(elementType, ed);
+ }
+
+ /**
+ * Look up the serializer to use for the extensibility element with
+ * the qname elementType, which was encountered as a child of the
+ * specified parentType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * definition this extension was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this extensibility element was found in the list of
+ * extensibility elements belonging to a javax.wsdl.Binding.
+ * @param elementType the qname of the extensibility element
+ *
+ * @return the extension serializer, if one was found. If none was
+ * found, the behavior depends on the value of the defaultSerializer
+ * property. If the defaultSerializer property is set to a non-null
+ * value, that value is returned; otherwise, a WSDLException is
+ * thrown.
+ *
+ * @see #registerSerializer(Class, QName, ExtensionSerializer)
+ * @see #setDefaultSerializer(ExtensionSerializer)
+ */
+ public ExtensionSerializer querySerializer(Class parentType,
+ QName elementType)
+ throws WSDLException
+ {
+ Map innerSerializerReg = (Map)serializerReg.get(parentType);
+ ExtensionSerializer es = null;
+
+ if (innerSerializerReg != null)
+ {
+ es = (ExtensionSerializer)innerSerializerReg.get(elementType);
+ }
+
+ if (es == null)
+ {
+ es = defaultSer;
+ }
+
+ if (es == null)
+ {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "No ExtensionSerializer found " +
+ "to serialize a '" + elementType +
+ "' element in the context of a '" +
+ parentType.getName() + "'.");
+ }
+
+ return es;
+ }
+
+ /**
+ * Look up the deserializer for the extensibility element with the
+ * qname elementType, which was encountered as an immediate child
+ * of the element represented by the specified parentType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility element was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this element was encountered as an immediate child of
+ * a <wsdl:binding> element.
+ * @param elementType the qname of the extensibility element
+ *
+ * @return the extension deserializer, if one was found. If none was
+ * found, the behavior depends on the value of the defaultDeserializer
+ * property. If the defaultDeserializer property is set to a non-null
+ * value, that value is returned; otherwise, a WSDLException is thrown.
+ *
+ * @see #registerDeserializer(Class, QName, ExtensionDeserializer)
+ * @see #setDefaultDeserializer(ExtensionDeserializer)
+ */
+ public ExtensionDeserializer queryDeserializer(Class parentType,
+ QName elementType)
+ throws WSDLException
+ {
+ Map innerDeserializerReg = (Map)deserializerReg.get(parentType);
+ ExtensionDeserializer ed = null;
+
+ if (innerDeserializerReg != null)
+ {
+ ed = (ExtensionDeserializer)innerDeserializerReg.get(elementType);
+ }
+
+ if (ed == null)
+ {
+ ed = defaultDeser;
+ }
+
+ if (ed == null)
+ {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "No ExtensionDeserializer found " +
+ "to deserialize a '" + elementType +
+ "' element in the context of a '" +
+ parentType.getName() + "'.");
+ }
+
+ return ed;
+ }
+
+ /**
+ * Look up the type of the extensibility element with the specified qname, which
+ * was defined as a child of the element represented by the specified parent class.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility attribute was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this attribute was defined on a <wsdl:binding> element.
+ * @param attrName the qname of the extensibility attribute
+ *
+ * @return one of the constants defined on the AttributeExtensible class
+ *
+ * @see #registerExtensionAttributeType(Class, QName, int)
+ * @see AttributeExtensible
+ */
+ public Class queryExtElementType(Class parentClass, QName elemQN)
+ {
+ Map innerExtensionAttributeReg =
+ (Map)extAttributeReg.get(parentClass);
+ Class elemClass = null;
+
+ if (innerExtensionAttributeReg != null)
+ {
+ elemClass = (Class)innerExtensionAttributeReg.get(elemQN);
+ }
+
+ return elemClass;
+ }
+
+ /**
+ * TODO make the return val typesafe, and create similar method for ext attrs.
+ *
+ * Returns a set of QNames representing the extensibility elements
+ * that are allowed as children of the specified parent type.
+ * Basically, this method returns the keys associated with the set
+ * of extension deserializers registered for this parent type.
+ * Returns null if no extension deserializers are registered for
+ * this parent type.
+ */
+ public Set getAllowableExtensions(Class parentType)
+ {
+ Map innerDeserializerReg = (Map)deserializerReg.get(parentType);
+
+ return (innerDeserializerReg != null)
+ ? innerDeserializerReg.keySet()
+ : null;
+ }
+
+ /**
+ * Declare that the specified extensionType is the concrete
+ * class which should be used to represent extensibility elements
+ * with qnames matching elementType, that are intended to exist as
+ * children of the specified parentType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * definition this extension would exist. For example,
+ * javax.wsdl.Binding.class would be used to indicate
+ * this extensibility element would be added to the list of
+ * extensibility elements belonging to a javax.wsdl.Binding,
+ * after being instantiated.
+ * @param elementType the qname of the extensibility element
+ * @param extensionType the concrete class which should be instantiated
+ *
+ * @see #createExtElement(Class, QName)
+ */
+ public void registerExtElementType(Class parentType,
+ QName elementType,
+ Class extensionType)
+ {
+ Map innerExtensionTypeReg = (Map)extElementReg.get(parentType);
+
+ if (innerExtensionTypeReg == null)
+ {
+ innerExtensionTypeReg = new Hashtable();
+
+ extElementReg.put(parentType, innerExtensionTypeReg);
+ }
+
+ innerExtensionTypeReg.put(elementType, extensionType);
+ }
+
+ /**
+ * Create an instance of the type which was declared to be used to
+ * represent extensibility elements with qnames matching elementType,
+ * when intended to exist as children of the specified parentType.
+ * This method allows a user to instantiate an extensibility element
+ * without having to know the implementing type.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * definition this extension will exist. For example,
+ * javax.wsdl.Binding.class would be used to indicate
+ * this extensibility element is going to be added to the list of
+ * extensibility elements belonging to a javax.wsdl.Binding,
+ * after being instantiated.
+ * @param elementType the qname of the extensibility element
+ *
+ * @return a new instance of the type used to represent the
+ * specified extension
+ *
+ * @see #registerExtElementType(Class, QName, Class)
+ */
+ public ExtensionElement createExtElement(Class parentType,
+ QName elementType)
+ throws WSDLException
+ {
+ Map innerExtensionTypeReg = (Map)extElementReg.get(parentType);
+ Class extensionType = null;
+
+ if (innerExtensionTypeReg != null)
+ {
+ extensionType = (Class)innerExtensionTypeReg.get(elementType);
+ }
+
+ if (extensionType == null)
+ {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "No Java extensionType found " +
+ "to represent a '" + elementType +
+ "' element in the context of a '" +
+ parentType.getName() + "'.");
+ }
+ else if (!(ExtensionElement.class.isAssignableFrom(extensionType)))
+ {
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "The Java extensionType '" +
+ extensionType.getName() + "' does " +
+ "not implement the ExtensibilityElement " +
+ "interface.");
+ }
+
+ try
+ {
+ ExtensionElement ee = (ExtensionElement)extensionType.newInstance();
+ /*
+ if (ee.getElementType() == null)
+ {
+ ee.setElementType(elementType);
+ }
+ */
+
+ return ee;
+ }
+ catch (Exception e)
+ {
+ /*
+ Catches:
+ InstantiationException
+ IllegalAccessException
+ */
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR,
+ "Problem instantiating Java " +
+ "extensionType '" + extensionType.getName() +
+ "'.",
+ e);
+ }
+ }
+
+ /**
+ * Declare that the type of the specified extension attribute, when it occurs
+ * as an attribute of the specified parent type, should be assumed to be
+ * attrType.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility attribute was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this attribute was defined on a <wsdl:binding> element.
+ * @param attrName the qname of the extensibility attribute
+ * @param attrType one of the constants defined on the AttributeExtensible
+ * class
+ *
+ * @see #queryExtensionAttributeType(Class, QName)
+ * @see AttributeExtensible
+ */
+ public void registerExtAttributeType(Class ownerClass,
+ QName attrQName,
+ Class attrClass)
+ {
+ Map innerExtensionAttributeReg =
+ (Map)extAttributeReg.get(ownerClass);
+
+ if (innerExtensionAttributeReg == null)
+ {
+ innerExtensionAttributeReg = new Hashtable();
+
+ extAttributeReg.put(ownerClass, innerExtensionAttributeReg);
+ }
+
+ innerExtensionAttributeReg.put(attrQName, attrClass);
+ }
+
+ /**
+ * Look up the type of the extensibility attribute with the specified qname,
+ * which was defined on an element represented by the specified parent class.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * document this extensibility attribute was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this attribute was defined on a <wsdl:binding> element.
+ * @param attrName the qname of the extensibility attribute
+ *
+ * @return one of the constants defined on the AttributeExtensible class
+ *
+ * @see #registerExtensionAttributeType(Class, QName, int)
+ * @see AttributeExtensible
+ */
+ public Class queryExtAttributeType(Class parentClass, QName attrQN)
+ {
+ Map innerExtensionAttributeReg =
+ (Map)extAttributeReg.get(parentClass);
+ Class attrClass = null;
+
+ if (innerExtensionAttributeReg != null)
+ {
+ attrClass = (Class)innerExtensionAttributeReg.get(attrQN);
+ }
+
+ return attrClass;
+ }
+
+ public XMLAttr createExtAttribute(Class ownerClass, QName attrQName)
+ throws WSDLException
+ {
+ Map innerExtensionAttributeReg = (Map)extAttributeReg.get(ownerClass);
+ Class implClass = null;
+ XMLAttr attr = null;
+
+ if (innerExtensionAttributeReg != null)
+ {
+ implClass = (Class)innerExtensionAttributeReg.get(attrQName);
+ }
+
+ //TODO remove this test code later
+ //if(XMLAttr.class.isAssignableFrom(implClass)) {
+ // System.out.println("XMLAttr is assignable from " + implClass.getName());
+ //}
+
+ if (implClass == null)
+ {
+ String msg = getErrorReporter().getFormattedMessage("WSDL010",
+ new Object[] {attrQName.toString(), ownerClass.getName()});
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg);
+ }
+ else if (!(XMLAttr.class.isAssignableFrom(implClass)))
+ {
+ String msg = getErrorReporter().getFormattedMessage("WSDL011",
+ new Object[] {attrQName.toString()});
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg);
+ }
+
+ try {
+ attr = (XMLAttr)implClass.newInstance();
+ attr.setErrorReporter(getErrorReporter());
+ }
+ catch (InstantiationException e)
+ {
+ String msg = getErrorReporter().getFormattedMessage("WSDL009",
+ new Object[] {implClass.getName()});
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg, e);
+ }
+ catch (IllegalAccessException e) {
+ String msg = getErrorReporter().getFormattedMessage("WSDL009",
+ new Object[] {implClass.getName()});
+ throw new WSDLException(WSDLException.CONFIGURATION_ERROR, msg, e);
+ }
+
+ return attr;
+ }
+}
\ No newline at end of file
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/ExtensionSerializer.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,45 @@
+/*
+ * (c) Copyright IBM Corp 2001, 2005
+ */
+
+package org.apache.woden.wsdl20.extensions;
+
+import java.io.PrintWriter;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+
+/**
+ * This interface should be implemented by classes which serialize
+ * extension-specific instances of ExtensibilityElement into the
+ * PrintWriter.
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ */
+public interface ExtensionSerializer
+{
+ /**
+ * This method serializes extension-specific instances of
+ * ExtensibilityElement into the PrintWriter.
+ *
+ * @param parentType a class object indicating where in the WSDL
+ * definition this extension was encountered. For
+ * example, javax.wsdl.Binding.class would be used to indicate
+ * this extensibility element was found in the list of
+ * extensibility elements belonging to a javax.wsdl.Binding.
+ * @param elementType the qname of the extensibility element
+ * @param extension the extensibility element to serialize
+ * @param def the definition this extensibility element was
+ * encountered in
+ * @param extReg the ExtensionRegistry to use (if needed again)
+ */
+ public void marshall(Class parentType,
+ QName elementType,
+ ExtensionElement extension,
+ PrintWriter pw,
+ DescriptionElement def,
+ ExtensionRegistry extReg)
+ throws WSDLException;
+}
\ No newline at end of file
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionDeserializer.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,49 @@
+/*
+ * (c) Copyright IBM Corp 2001, 2005
+ */
+
+package org.apache.woden.wsdl20.extensions;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.util.dom.DOMUtils;
+import org.apache.woden.internal.wsdl20.Constants;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+import org.w3c.dom.Element;
+
+/**
+ * This class is used to deserialize arbitrary elements into
+ * UnknownExtensionElement instances.
+ *
+ * @see UnknownExtensionElement
+ * @see UnknownExtensionSerializer
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ */
+public class UnknownExtensionDeserializer implements ExtensionDeserializer
+{
+ public ExtensionElement unmarshall(Class parentType,
+ QName elementType,
+ Element el,
+ DescriptionElement desc,
+ ExtensionRegistry extReg)
+ throws WSDLException
+ {
+ UnknownExtensionElement unknownExt = new UnknownExtensionElement();
+ String requiredStr = DOMUtils.getAttributeNS(el,
+ Constants.NS_URI_WSDL20,
+ Constants.ATTR_REQUIRED);
+
+ unknownExt.setElementType(elementType);
+
+ if (requiredStr != null)
+ {
+ unknownExt.setRequired(new Boolean(requiredStr));
+ }
+
+ unknownExt.setElement(el);
+
+ return unknownExt;
+ }
+}
\ No newline at end of file
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionElement.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,97 @@
+/*
+ * (c) Copyright IBM Corp 2001, 2005
+ */
+
+package org.apache.woden.wsdl20.extensions;
+
+import org.w3c.dom.*;
+import javax.xml.namespace.*;
+
+/**
+ * This class is used to wrap arbitrary elements.
+ *
+ * @see UnknownExtensionSerializer
+ * @see UnknownExtensionDeserializer
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ */
+public class UnknownExtensionElement implements ExtensionElement
+{
+ protected QName elementType = null;
+ // Uses the wrapper type so we can tell if it was set or not.
+ protected Boolean required = null;
+ protected Element element = null;
+
+ /**
+ * Set the type of this extensibility element.
+ *
+ * @param elementType the type
+ */
+ public void setElementType(QName elementType)
+ {
+ this.elementType = elementType;
+ }
+
+ /**
+ * Get the type of this extensibility element.
+ *
+ * @return the extensibility element's type
+ */
+ public QName getElementType()
+ {
+ return elementType;
+ }
+
+ /**
+ * Set whether or not the semantics of this extension
+ * are required. Relates to the wsdl:required attribute.
+ */
+ public void setRequired(Boolean required)
+ {
+ this.required = required;
+ }
+
+ /**
+ * Get whether or not the semantics of this extension
+ * are required. Relates to the wsdl:required attribute.
+ */
+ public Boolean getRequired()
+ {
+ return required;
+ }
+
+ /**
+ * Set the Element for this extensibility element.
+ *
+ * @param element the unknown element that was encountered
+ */
+ public void setElement(Element element)
+ {
+ this.element = element;
+ }
+
+ /**
+ * Get the Element for this extensibility element.
+ *
+ * @return the unknown element that was encountered
+ */
+ public Element getElement()
+ {
+ return element;
+ }
+
+ public String toString()
+ {
+ StringBuffer strBuf = new StringBuffer();
+
+ strBuf.append("UnknownExtensionElement (" + elementType + "):");
+ strBuf.append("\nrequired=" + required);
+
+ if (element != null)
+ {
+ strBuf.append("\nelement=" + element);
+ }
+
+ return strBuf.toString();
+ }
+}
\ No newline at end of file
Added: incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java
URL: http://svn.apache.org/viewcvs/incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java?rev=354070&view=auto
==============================================================================
--- incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java (added)
+++ incubator/woden/java/src/org/apache/woden/wsdl20/extensions/UnknownExtensionSerializer.java Mon Dec 5 05:40:47 2005
@@ -0,0 +1,43 @@
+/*
+ * (c) Copyright IBM Corp 2001, 2005
+ */
+
+package org.apache.woden.wsdl20.extensions;
+
+import java.io.PrintWriter;
+
+import javax.xml.namespace.QName;
+
+import org.apache.woden.WSDLException;
+import org.apache.woden.internal.util.dom.DOM2Writer;
+import org.apache.woden.wsdl20.xml.DescriptionElement;
+
+/**
+ * This class is used to serialize UnknownExtensionElement instances
+ * into the PrintWriter.
+ *
+ * @see UnknownExtensionElement
+ * @see UnknownExtensionDeserializer
+ *
+ * @author Matthew J. Duftler (duftler@us.ibm.com)
+ */
+public class UnknownExtensionSerializer implements ExtensionSerializer
+{
+ public void marshall(Class parentType,
+ QName elementType,
+ ExtensionElement extension,
+ PrintWriter pw,
+ DescriptionElement desc,
+ ExtensionRegistry extReg)
+ throws WSDLException
+ {
+ UnknownExtensionElement unknownExt =
+ (UnknownExtensionElement)extension;
+
+ pw.print(" ");
+
+ DOM2Writer.serializeAsXML(unknownExt.getElement(), pw);
+
+ pw.println();
+ }
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: woden-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: woden-dev-help@ws.apache.org