diff --git a/xstream-distribution/src/content/architecture.html b/xstream-distribution/src/content/architecture.html index bdf8b6884..473ffa0c7 100644 --- a/xstream-distribution/src/content/architecture.html +++ b/xstream-distribution/src/content/architecture.html @@ -1,7 +1,7 @@ +
An XStream instance envisages two phases in its life cycle: Setup and Execution. A lot of default configuration is + already applied when an XStream instance is instantiated, i.e. the instance is directly in setup phase. Now is + the time to apply further configuration. This phase is not thread-safe.
+ +Once an instance is properly configured in can be used in an execution phase, where + Java object graphs are marshalled and unmarshalled. The execution phase is + thread-safe, i.e. is is possible to use an XStream instance concurrently for execution. However, XStream + builds caches during execution based on the configuration. Therefore, an instance should never be reconfigured + during or after execution phase. The result of any further (un-)marshalling might not be what is expected.
+ + +Whenever XStream encounters an object that needs to be converted to/from XML, it delegates to a suitable @@ -36,13 +51,28 @@
XStream comes bundled with many converters for common types, including primitives, String, Collections, arrays, null, Date, etc.
-XStream also has a default Converter, that is used when no other Converters match a type. This uses +
XStream also has a default Converter, that is used when no other Converters match a type. This uses reflection to automatically generate the XML for all the fields in an object.
If an object is composed of other objects, the Converter may delegate to other Converters.
To customize the XML for particular object type a new Converter should be implemented.
+ + +Mapper implementations are the key + components to map between names used in XML and names of Java elements and vice versa. Mappers are organized + in a chain, e.g. every time a mapper cannot map a special name it delegates the call to its logical parent. + Mappers keep the configuration in XStream and a converter should always use the Mapper (chain) of XStream to + map names it has to deal with.
+ +XStream comes bundled with many mappers to map names of ordinary Java types and elements, of arrays, enums, + proxies, outer classes, to handle alias definitions, implicit collections, and ignored elements and even the + Security Framework is based on a Mapper implementation.
+ +Overwrite XStream's wrapMapper function to add custom mapper implementation.
@@ -119,6 +149,14 @@XStream's Security Framework consists of a Mapper implementation and + a lot of type permissions. These + implementations are used to deny or allow the deserialization of java types based on their name or type + hierarchy.
@@ -131,6 +169,5 @@Remember, the XStream class is just a facade - it can always be bypassed for more advanced operations.
-