hudson.plugins.filesfoundtrigger.xstream
Class DefaultingConverter

java.lang.Object
  extended by hudson.util.XStream2.PassthruConverter<java.lang.Object>
      extended by hudson.plugins.filesfoundtrigger.xstream.DefaultingConverter
All Implemented Interfaces:
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Direct Known Subclasses:
FilesFoundTrigger.ConverterImpl, FilesFoundTriggerCause.ConverterImpl

public class DefaultingConverter
extends hudson.util.XStream2.PassthruConverter<java.lang.Object>

XStream converter that applies default values to fields marked with the XStreamDefault annotation when unmarshalling an object. Only fields that do not appear in the input XML data are assigned a default value. Ordinarily, these fields default to null.

To use, create a nested ConverterImpl subclass that extends this class. Example:

 public static class ConverterImpl extends DefaultingConverter {
   public ConverterImpl(XStream2 xstream) {
     super(xstream);
   }
 }
 

Author:
Steven G. Brown

Constructor Summary
DefaultingConverter(hudson.util.XStream2 xstream)
          Create a new DefaultingConverter.
 
Method Summary
protected  void callback(java.lang.Object obj, com.thoughtworks.xstream.converters.UnmarshallingContext context)
          
 
Methods inherited from class hudson.util.XStream2.PassthruConverter
canConvert, marshal, unmarshal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultingConverter

public DefaultingConverter(hudson.util.XStream2 xstream)
Create a new DefaultingConverter.

Parameters:
xstream - reference to the XStream library
Method Detail

callback

protected void callback(java.lang.Object obj,
                        com.thoughtworks.xstream.converters.UnmarshallingContext context)

Specified by:
callback in class hudson.util.XStream2.PassthruConverter<java.lang.Object>


Copyright © 2010. All Rights Reserved.