From 8d9c07b5143659526a5e3c08b97d0bb03dfbfe68 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma Date: Fri, 27 Aug 2010 09:12:45 +0000 Subject: [PATCH] SWS-639 - Deprecate redundant XML classes --- .../xml/transform/StaxResult.java | 4 +++- .../xml/transform/StaxSource.java | 4 +++- .../springframework/xml/transform/TraxUtils.java | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/xml/src/main/java/org/springframework/xml/transform/StaxResult.java b/xml/src/main/java/org/springframework/xml/transform/StaxResult.java index f0ca9541..77f42b25 100644 --- a/xml/src/main/java/org/springframework/xml/transform/StaxResult.java +++ b/xml/src/main/java/org/springframework/xml/transform/StaxResult.java @@ -45,8 +45,10 @@ import org.xml.sax.ContentHandler; * @see XMLStreamWriter * @see javax.xml.transform.Transformer * @since 1.0.0 + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#createStaxResult(XMLEventWriter)} and {@link + * org.springframework.util.xml.StaxUtils#createStaxResult(XMLStreamWriter)} */ -@SuppressWarnings("Since15") +@Deprecated public class StaxResult extends SAXResult { private XMLEventWriter eventWriter; diff --git a/xml/src/main/java/org/springframework/xml/transform/StaxSource.java b/xml/src/main/java/org/springframework/xml/transform/StaxSource.java index abfd5d22..043c3fcc 100644 --- a/xml/src/main/java/org/springframework/xml/transform/StaxSource.java +++ b/xml/src/main/java/org/springframework/xml/transform/StaxSource.java @@ -45,8 +45,10 @@ import org.xml.sax.XMLReader; * @see XMLStreamReader * @see javax.xml.transform.Transformer * @since 1.0.0 + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#createStaxSource(XMLEventReader)} and {@link + * org.springframework.util.xml.StaxUtils#createStaxSource(XMLStreamReader)} */ -@SuppressWarnings("Since15") +@Deprecated public class StaxSource extends SAXSource { private XMLEventReader eventReader; diff --git a/xml/src/main/java/org/springframework/xml/transform/TraxUtils.java b/xml/src/main/java/org/springframework/xml/transform/TraxUtils.java index 8f7b12c5..7156fe47 100644 --- a/xml/src/main/java/org/springframework/xml/transform/TraxUtils.java +++ b/xml/src/main/java/org/springframework/xml/transform/TraxUtils.java @@ -59,7 +59,9 @@ public abstract class TraxUtils { * * @return true if source is a Spring-WS {@link StaxSource} or JAXP 1.4 {@link * StAXSource}; false otherwise. + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#isStaxSource(Source)} */ + @Deprecated public static boolean isStaxSource(Source source) { if (source instanceof StaxSource) { return true; @@ -77,7 +79,9 @@ public abstract class TraxUtils { * * @return true if result is a Spring-WS {@link StaxResult} or JAXP 1.4 {@link * StAXResult}; false otherwise. + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#isStaxResult(Result)} */ + @Deprecated public static boolean isStaxResult(Result result) { if (result instanceof StaxResult) { return true; @@ -97,7 +101,9 @@ public abstract class TraxUtils { * @return the {@link XMLStreamReader} * @throws IllegalArgumentException if source is neither a Spring-WS {@link StaxSource} or {@link * StAXSource} + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#getXMLStreamReader(Source)} */ + @Deprecated public static XMLStreamReader getXMLStreamReader(Source source) { if (source instanceof StaxSource) { return ((StaxSource) source).getXMLStreamReader(); @@ -117,7 +123,9 @@ public abstract class TraxUtils { * @return the {@link XMLEventReader} * @throws IllegalArgumentException if source is neither a Spring-WS {@link StaxSource} or {@link * StAXSource} + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#getXMLEventReader(Source)} */ + @Deprecated public static XMLEventReader getXMLEventReader(Source source) { if (source instanceof StaxSource) { return ((StaxSource) source).getXMLEventReader(); @@ -137,7 +145,9 @@ public abstract class TraxUtils { * @return the {@link XMLStreamReader} * @throws IllegalArgumentException if source is neither a Spring-WS {@link StaxResult} or {@link * StAXResult} + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#getXMLStreamWriter(Result)} */ + @Deprecated public static XMLStreamWriter getXMLStreamWriter(Result result) { if (result instanceof StaxResult) { return ((StaxResult) result).getXMLStreamWriter(); @@ -157,7 +167,9 @@ public abstract class TraxUtils { * @return the {@link XMLStreamReader} * @throws IllegalArgumentException if source is neither a Spring-WS {@link StaxResult} or {@link * StAXResult} + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#getXMLEventWriter(Result)} */ + @Deprecated public static XMLEventWriter getXMLEventWriter(Result result) { if (result instanceof StaxResult) { return ((StaxResult) result).getXMLEventWriter(); @@ -176,7 +188,9 @@ public abstract class TraxUtils { * * @param streamReader the StAX stream reader * @return a source wrapping streamReader + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#createStaxSource(XMLStreamReader)} */ + @Deprecated public static Source createStaxSource(XMLStreamReader streamReader) { if (JaxpVersion.isAtLeastJaxp14()) { return Jaxp14StaxHandler.createStaxSource(streamReader); @@ -193,7 +207,9 @@ public abstract class TraxUtils { * @param eventReader the StAX event reader * @return a source wrapping eventReader * @throws XMLStreamException in case of StAX errors + * @deprecated In favor of {@link org.springframework.util.xml.StaxUtils#createStaxSource(XMLEventReader)} */ + @Deprecated public static Source createStaxSource(XMLEventReader eventReader) throws XMLStreamException { if (JaxpVersion.isAtLeastJaxp14()) { return Jaxp14StaxHandler.createStaxSource(eventReader);