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 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) - Provide implementation for V[X]Migrator.migrate() algorithm - If parsing algorithm has changed, update V[X]Migrator.readGlobalBuildStatsPOJO with the new algorithm (if, for example, new root elements has appeared in XStream file) - Update GlobalBuildStatsXStreamConverter.MIGRATORS with new provided class- Author:
- fcamblor
-
-
Field Summary
Fields Modifier and Type Field Description static String
BUILD_SEARCH_CRITERIA_CLASS_ALIAS
static String
BUILD_STAT_CONFIG_CLASS_ALIAS
static String
HISTORIC_SCALE_CLASS_ALIAS
static String
JOB_BUILD_RESULT_CLASS_ALIAS
static String
RETENTION_STRATEGY_CLASS_ALIAS
static String
YAXIS_CHART_DIMENSION_CLASS_ALIAS
static String
YAXIS_CHART_TYPE_CLASS_ALIAS
-
Constructor Summary
Constructors Constructor Description GlobalBuildStatsXStreamConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canConvert(Class type)
Converter is only applicable on GlobalBuildStatsPlugin datavoid
marshal(Object source, com.thoughtworks.xstream.io.HierarchicalStreamWriter writer, com.thoughtworks.xstream.converters.MarshallingContext context)
protected void
populateGlobalBuildStatsPlugin(GlobalBuildStatsPlugin plugin, GlobalBuildStatsPOJO pojo)
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
-
-
-
Field Detail
-
BUILD_STAT_CONFIG_CLASS_ALIAS
public static final String BUILD_STAT_CONFIG_CLASS_ALIAS
- See Also:
- Constant Field Values
-
JOB_BUILD_RESULT_CLASS_ALIAS
public static final String JOB_BUILD_RESULT_CLASS_ALIAS
- See Also:
- Constant Field Values
-
RETENTION_STRATEGY_CLASS_ALIAS
public static final String RETENTION_STRATEGY_CLASS_ALIAS
- See Also:
- Constant Field Values
-
BUILD_SEARCH_CRITERIA_CLASS_ALIAS
public static final String BUILD_SEARCH_CRITERIA_CLASS_ALIAS
- See Also:
- Constant Field Values
-
HISTORIC_SCALE_CLASS_ALIAS
public static final String HISTORIC_SCALE_CLASS_ALIAS
- See Also:
- Constant Field Values
-
YAXIS_CHART_TYPE_CLASS_ALIAS
public static final String YAXIS_CHART_TYPE_CLASS_ALIAS
- See Also:
- Constant Field Values
-
YAXIS_CHART_DIMENSION_CLASS_ALIAS
public static final String YAXIS_CHART_DIMENSION_CLASS_ALIAS
- See Also:
- Constant Field Values
-
-
Method Detail
-
canConvert
public boolean canConvert(Class type)
Converter is only applicable on GlobalBuildStatsPlugin data- Specified by:
canConvert
in interfacecom.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 interfacecom.thoughtworks.xstream.converters.Converter
-
unmarshal
public 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 interfacecom.thoughtworks.xstream.converters.Converter
-
populateGlobalBuildStatsPlugin
protected void populateGlobalBuildStatsPlugin(GlobalBuildStatsPlugin plugin, GlobalBuildStatsPOJO pojo)
-
-