Registering a Custom Converter
Normally, you'd register converter to the class you are writing, and in that case the easiest thing to do is to write a nested type "ConverterImpl", that gets picked up automatically. If you search by that class name, you'll see a number of implementations.
Registering a Custom Converter without modifying the original class
If you want to register a custom XStream converter that will convert items that have already been persisted to disk, and you don't want to modify the source code for the class you want to convert, then you need to hook it in to Hudson before it reads in those items. Here's one way that works:
Items.XSTREAM portion should be adjusted to point to the right XStream instance (such as
Hudson.XSTREAM), depending on which persistence your object participates. The converter would look something like this: