hudson.util
Class XStream2.PassthruConverter<T>

java.lang.Object
  extended by hudson.util.XStream2.PassthruConverter<T>
All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Direct Known Subclasses:
Cause.UpstreamCause.ConverterImpl, CauseAction.ConverterImpl, HealthReport.ConverterImpl, HudsonPrivateSecurityRealm.Details.ConverterImpl, ToolInstallation.ToolConverter
Enclosing class:
XStream2

public abstract static class XStream2.PassthruConverter<T>
extends Object
implements com.thoughtworks.xstream.converters.Converter

Create a nested ConverterImpl subclass that extends this class to run some callback code just after a type is unmarshalled by RobustReflectionConverter. Example:

 public static class ConverterImpl extends XStream2.PassthruConverter<MyType> {
   public ConverterImpl(XStream2 xstream) { super(xstream); }


Constructor Summary
XStream2.PassthruConverter(XStream2 xstream)
           
 
Method Summary
protected abstract  void callback(T obj, com.thoughtworks.xstream.converters.UnmarshallingContext context)
           
 boolean canConvert(Class type)
           
 void marshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
           
 Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader, com.thoughtworks.xstream.converters.UnmarshallingContext context)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XStream2.PassthruConverter

public XStream2.PassthruConverter(XStream2 xstream)
Method Detail

canConvert

public boolean canConvert(Class type)
Specified by:
canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher

marshal

public void marshal(Object source,
                    com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
                    com.thoughtworks.xstream.converters.MarshallingContext context)
Specified by:
marshal in interface com.thoughtworks.xstream.converters.Converter

unmarshal

public Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
                        com.thoughtworks.xstream.converters.UnmarshallingContext context)
Specified by:
unmarshal in interface com.thoughtworks.xstream.converters.Converter

callback

protected abstract void callback(T obj,
                                 com.thoughtworks.xstream.converters.UnmarshallingContext context)


Copyright © 2004-2013. All Rights Reserved.