diff --git a/core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java b/core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
index 7b457aaf..4eac58d9 100644
--- a/core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
+++ b/core/src/main/java/org/springframework/ws/transport/http/XsdSchemaHandlerAdapter.java
@@ -36,7 +36,14 @@ import org.springframework.xml.transform.TraxUtils;
import org.springframework.xml.xsd.XsdSchema;
/**
+ * Adapter to use the {@link XsdSchema} interface with the generic DispatcherServlet.
+ *
HttpServletResponse. Allows for post-processing the schema in subclasses.
+ *
* @author Arjen Poutsma
+ * @see XsdSchema
+ * @see #getSchemaSource(XsdSchema)
* @since 1.5.3
*/
public class XsdSchemaHandlerAdapter extends TransformerObjectSupport implements HandlerAdapter {
@@ -81,8 +88,7 @@ public class XsdSchemaHandlerAdapter extends TransformerObjectSupport implements
if (HttpTransportConstants.METHOD_GET.equals(request.getMethod())) {
response.setContentType(CONTENT_TYPE);
Transformer transformer = createTransformer();
- XsdSchema schema = (XsdSchema) handler;
- Source schemaSource = schema.getSource();
+ Source schemaSource = getSchemaSource((XsdSchema) handler);
StreamResult responseResult = new StreamResult(response.getOutputStream());
transformer.transform(schemaSource, responseResult);
}
@@ -91,4 +97,19 @@ public class XsdSchemaHandlerAdapter extends TransformerObjectSupport implements
}
return null;
}
+
+ /**
+ * Returns the {@link Source} of the given schema. Allows for post-processing and transformation of the schema in
+ * sub-classes.
+ *
+ * Default implementation simply returns {@link XsdSchema#getSource()}.
+ *
+ * @param schema the schema
+ * @return the source of the given schema
+ * @throws Exception in case of errors
+ */
+ protected Source getSchemaSource(XsdSchema schema) throws Exception {
+ return schema.getSource();
+ }
+
}
\ No newline at end of file