Polishing

This commit is contained in:
Juergen Hoeller
2016-12-20 21:11:07 +01:00
parent 8662c61a17
commit 9cb4de8b5e
5 changed files with 23 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 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,27 +23,27 @@ 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.
*
* <p>Main purpose of this class is to
* {@linkplain com.thoughtworks.xstream.XStream#registerConverter(Converter, int) register}
* this converter as a catch-all converter with a
* <p>The main purpose of this class is to
* {@linkplain com.thoughtworks.xstream.XStream#registerConverter(com.thoughtworks.xstream.converters.Converter, int) register}
* this converter as a catch-all last 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.
* or higher priority, in addition to converters that explicitly handle the domain
* classes that should be supported. As a result, default XStream converters with
* lower priorities and possible security vulnerabilities do not get invoked.
*
* <p>For instance:</p>
* <p>For instance:
* <pre class="code">
* XStreamMarshaller unmarshaller = new XStreamMarshaller();
* unmarshaller.getXStream().registerConverter(new MyDomainClassConverter(), XStream.PRIORITY_VERY_HIGH);
* unmarshaller.getXStream().registerConverter(new CatchAllConverter(), XStream.PRIORITY_NORMAL);
* MyDomainClass o = unmarshaller.unmarshal(source);
* MyDomainClass myObject = unmarshaller.unmarshal(source);
* </pre
*
* @author Arjen Poutsma
* @since 4.0
* @since 3.2.5
*/
public class CatchAllConverter implements Converter {