Package hudson.util

Class XStream2.PassthruConverter<T>

java.lang.Object
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); }
   @Override protected void callback(MyType obj, UnmarshallingContext context) {
     ...
 
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract void
    callback(T obj, com.thoughtworks.xstream.converters.UnmarshallingContext context)
     
    boolean
     
    void
    marshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
     
    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 Details

    • PassthruConverter

      protected PassthruConverter(XStream2 xstream)
  • Method Details

    • 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)