Remove generics from WebServiceMessage

This commit is contained in:
Arjen Poutsma
2010-11-09 10:53:47 +00:00
parent 14d695c2db
commit e376c868c3
7 changed files with 32 additions and 10 deletions

View File

@@ -29,14 +29,14 @@ import java.io.InputStream;
* @see org.springframework.ws.WebServiceMessage
* @since 1.0.0
*/
public interface WebServiceMessageFactory<T extends WebServiceMessage> {
public interface WebServiceMessageFactory {
/**
* Creates a new, empty <code>WebServiceMessage</code>.
*
* @return the empty message
*/
T createWebServiceMessage();
WebServiceMessage createWebServiceMessage();
/**
* Reads a {@link WebServiceMessage} from the given input stream.
@@ -48,6 +48,6 @@ public interface WebServiceMessageFactory<T extends WebServiceMessage> {
* @return the created message
* @throws java.io.IOException if an I/O exception occurs
*/
T createWebServiceMessage(InputStream inputStream) throws IOException;
WebServiceMessage createWebServiceMessage(InputStream inputStream) throws IOException;
}

View File

@@ -37,7 +37,7 @@ import org.xml.sax.SAXException;
* @see org.springframework.ws.pox.dom.DomPoxMessage
* @since 1.0.0
*/
public class DomPoxMessageFactory extends TransformerObjectSupport implements WebServiceMessageFactory<DomPoxMessage> {
public class DomPoxMessageFactory extends TransformerObjectSupport implements WebServiceMessageFactory {
/** The default content type for the POX messages. */
public static final String DEFAULT_CONTENT_TYPE = "application/xml";

View File

@@ -16,6 +16,9 @@
package org.springframework.ws.soap;
import java.io.IOException;
import java.io.InputStream;
import org.springframework.ws.WebServiceMessageFactory;
/**
@@ -27,7 +30,7 @@ import org.springframework.ws.WebServiceMessageFactory;
* @author Arjen Poutsma
* @since 1.0.0
*/
public interface SoapMessageFactory<T extends SoapMessage> extends WebServiceMessageFactory<T> {
public interface SoapMessageFactory extends WebServiceMessageFactory {
/**
* Sets the SOAP Version used by this factory.
@@ -38,4 +41,23 @@ public interface SoapMessageFactory<T extends SoapMessage> extends WebServiceMes
*/
void setSoapVersion(SoapVersion version);
/**
* Creates a new, empty <code>SoapMessage</code>.
*
* @return the empty message
*/
SoapMessage createWebServiceMessage();
/**
* Reads a {@link SoapMessage} from the given input stream.
* <p/>
* If the given stream is an instance of {@link org.springframework.ws.transport.TransportInputStream
* TransportInputStream}, the headers will be read from the request.
*
* @param inputStream the input stream to read the message from
* @return the created message
* @throws java.io.IOException if an I/O exception occurs
*/
SoapMessage createWebServiceMessage(InputStream inputStream) throws IOException;
}

View File

@@ -78,7 +78,7 @@ import org.apache.commons.logging.LogFactory;
* @see #setPayloadCaching(boolean)
* @since 1.0.0
*/
public class AxiomSoapMessageFactory implements SoapMessageFactory<AxiomSoapMessage>, InitializingBean {
public class AxiomSoapMessageFactory implements SoapMessageFactory, InitializingBean {
private static final String CHARSET_PARAMETER = "charset";

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2010 the original author or authors.
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -55,7 +55,7 @@ import org.apache.commons.logging.LogFactory;
* @see org.springframework.ws.soap.saaj.SaajSoapMessage
* @since 1.0.0
*/
public class SaajSoapMessageFactory implements SoapMessageFactory<SaajSoapMessage>, InitializingBean {
public class SaajSoapMessageFactory implements SoapMessageFactory, InitializingBean {
private static final Log logger = LogFactory.getLog(SaajSoapMessageFactory.class);

View File

@@ -21,7 +21,7 @@ import java.io.InputStream;
import javax.xml.transform.TransformerException;
import javax.xml.transform.stream.StreamSource;
public class MockWebServiceMessageFactory implements WebServiceMessageFactory<MockWebServiceMessage> {
public class MockWebServiceMessageFactory implements WebServiceMessageFactory {
public MockWebServiceMessage createWebServiceMessage() {
return new MockWebServiceMessage();

View File

@@ -30,7 +30,7 @@ import org.springframework.ws.soap.SoapVersion;
/**
* @author Arjen Poutsma
*/
public class StroapMessageFactory implements SoapMessageFactory<StroapMessage> {
public class StroapMessageFactory implements SoapMessageFactory {
private final XMLInputFactory inputFactory = createXmlInputFactory();