hudson.plugins.global_build_stats.xstream
Class GlobalBuildStatsXStreamConverter
java.lang.Object
hudson.plugins.global_build_stats.xstream.GlobalBuildStatsXStreamConverter
- All Implemented Interfaces:
- com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
public class GlobalBuildStatsXStreamConverter
- extends java.lang.Object
- implements com.thoughtworks.xstream.converters.Converter
XStream converter for GlobalBuildStatsPlugin XStream data
Allows to provide API to migrate from one version to another of persisted global build stats data
When creating a new migrator you must :
- Create a new package hudson.plugins.global_build_stats.xstream.migration.v[X]
- Inside this package, copy/paste every classes located in hudson.plugins.global_build_stats.xstream.migration.v[X-1]
- Rename every *V[X-1]* POJOs to *V[X]* POJO
- Eventually, change attributes in V[X]GlobalBuildStatsPOJO (for example, if additionnal attribute has appeared)
- If parsing algorithm has changed, update V[X]XstreamReader with the new algorithm (if, for example, new root elements
has appeared in XStream file)
- Update GlobalBuildStatsXStreamConverter.populateGlobalBuildStatsPlugin() and cast pojo parameter to last
V[X]GlobalBuildStatsPOJO
- Update GlobalBuildStatsXStreamConverter.READERS and GlobalBuildStatsXStreamConverter.MIGRATORS with new provided classes
- Author:
- fcamblor
|
Method Summary |
boolean |
canConvert(java.lang.Class type)
Converter is only applicable on GlobalBuildStatsPlugin data |
void |
marshal(java.lang.Object source,
com.thoughtworks.xstream.io.HierarchicalStreamWriter writer,
com.thoughtworks.xstream.converters.MarshallingContext context)
|
protected void |
populateGlobalBuildStatsPlugin(GlobalBuildStatsPlugin plugin,
GlobalBuildStatsPOJO pojo)
|
java.lang.Object |
unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
Will transform global build stats XStream data representation into
current GlobalBuildStatsPlugin instance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BUILD_STAT_CONFIG_CLASS_ALIAS
public static final java.lang.String BUILD_STAT_CONFIG_CLASS_ALIAS
- See Also:
- Constant Field Values
JOB_BUILD_RESULT_CLASS_ALIAS
public static final java.lang.String JOB_BUILD_RESULT_CLASS_ALIAS
- See Also:
- Constant Field Values
GlobalBuildStatsXStreamConverter
public GlobalBuildStatsXStreamConverter()
canConvert
public boolean canConvert(java.lang.Class type)
- Converter is only applicable on GlobalBuildStatsPlugin data
- Specified by:
canConvert in interface com.thoughtworks.xstream.converters.ConverterMatcher
marshal
public void marshal(java.lang.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 java.lang.Object unmarshal(com.thoughtworks.xstream.io.HierarchicalStreamReader reader,
com.thoughtworks.xstream.converters.UnmarshallingContext context)
- Will transform global build stats XStream data representation into
current GlobalBuildStatsPlugin instance
- Specified by:
unmarshal in interface com.thoughtworks.xstream.converters.Converter
populateGlobalBuildStatsPlugin
protected void populateGlobalBuildStatsPlugin(GlobalBuildStatsPlugin plugin,
GlobalBuildStatsPOJO pojo)
Copyright © 2010. All Rights Reserved.