diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java index 8f7736b7a3..ee799f973f 100644 --- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java +++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/CatchAllConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2013 the original author or authors. + * Copyright 2002-2014 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. @@ -23,15 +23,17 @@ import com.thoughtworks.xstream.io.HierarchicalStreamReader; import com.thoughtworks.xstream.io.HierarchicalStreamWriter; /** - * XStream {@link Converter} that supports all classes, but throws exceptions for - * (un)marshalling. + * XStream {@link Converter} that supports all classes but throws exceptions + * for (un)marshalling. + * *

Main purpose of this class is to - * {@linkplain com.thoughtworks.xstream.XStream#registerConverter(com.thoughtworks.xstream.converters.Converter, int) register} - * this converter as a catchall converter with a + * {@linkplain com.thoughtworks.xstream.XStream#registerConverter(Converter, int) register} + * this converter as a catch-all converter with a * {@linkplain com.thoughtworks.xstream.XStream#PRIORITY_NORMAL normal} * or higher priority, in addition to converters that explicitly support the domain * classes that should be supported. As a result, default XStream converters with lower * priorities and possible security vulnerabilities do not get invoked. + * *

For instance:

*
  * XStreamMarshaller unmarshaller = new XStreamMarshaller();
@@ -52,14 +54,13 @@ public class CatchAllConverter implements Converter {
 	}
 
 	@Override
-	public void marshal(Object source, HierarchicalStreamWriter writer,
-			MarshallingContext context) {
-		throw new UnsupportedOperationException("marshalling not supported");
+	public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context) {
+		throw new UnsupportedOperationException("Marshalling not supported");
 	}
 
 	@Override
-	public Object unmarshal(HierarchicalStreamReader reader,
-			UnmarshallingContext context) {
-		throw new UnsupportedOperationException("unmarshalling not supported");
+	public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) {
+		throw new UnsupportedOperationException("Unmarshalling not supported");
 	}
+
 }
diff --git a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java
index f15313e746..de42e5bbef 100644
--- a/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java
+++ b/spring-oxm/src/main/java/org/springframework/oxm/xstream/XStreamMarshaller.java
@@ -91,13 +91,12 @@ import org.springframework.util.xml.StaxUtils;
  * as this can result in security vulnerabilities. If you do use the
  * {@code XStreamMarshaller} to unmarshal external XML, set the
  * {@link #setSupportedClasses(Class[]) supportedClasses} and
- * {@link #setConverters(ConverterMatcher[]) converters} properties (possibly using a
- * {@link CatchAllConverter}) or override the
- * {@link #customizeXStream(XStream)} method to make sure it only accepts the classes
- * you want it to support.
+ * {@link #setConverters(ConverterMatcher[]) converters} properties (possibly using
+ * a {@link CatchAllConverter}) or override the {@link #customizeXStream(XStream)}
+ * method to make sure it only accepts the classes you want it to support.
  *
- * 

Due to XStream's API, it is required to set the encoding used for writing to OutputStreams. - * It defaults to {@code UTF-8}. + *

Due to XStream's API, it is required to set the encoding used for writing to + * OutputStreams. It defaults to {@code UTF-8}. * *

NOTE: XStream is an XML serialization library, not a data binding library. * Therefore, it has limited namespace support. As such, it is rather unsuitable for