Class DefaultXStreamManager
- java.lang.Object
-
- com.atlassian.bamboo.persister.xstream.DefaultXStreamManager
-
- All Implemented Interfaces:
XStreamManager
public class DefaultXStreamManager extends Object implements XStreamManager
Default implementation ofXStreamManager
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultXStreamManager.PluginXStreams
Internal class that maintains mappings from plugins to corresponding XStreams
-
Constructor Summary
Constructors Constructor Description DefaultXStreamManager(@NotNull com.atlassian.plugin.PluginAccessor pluginAccessor, @Nullable com.atlassian.plugin.event.PluginEventManager pluginEventManager, @NotNull XStreamFactory xStreamFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
fromXML(String xml)
Convert the xml into a java Object instanceObject
fromXML(String pluginKey, String serializedData)
Convert XML serializedData into an object in the context of plugin referred to by pluginKey.static DefaultXStreamManager
getNonPluginAwareInstance(XStreamFactory xStreamFactory)
A non-plugin aware instance that will always use the same underlying XStream instance with default class loader.void
postConstruct()
String
toXML(Object object)
Convert the java object into its XML formvoid
toXML(Object object, OutputStream outputStream)
Convert the java object into its XML form and stream it to the output stream provided.
-
-
-
Constructor Detail
-
DefaultXStreamManager
public DefaultXStreamManager(@NotNull @NotNull com.atlassian.plugin.PluginAccessor pluginAccessor, @Nullable @Nullable com.atlassian.plugin.event.PluginEventManager pluginEventManager, @NotNull @NotNull XStreamFactory xStreamFactory)
-
-
Method Detail
-
getNonPluginAwareInstance
public static DefaultXStreamManager getNonPluginAwareInstance(XStreamFactory xStreamFactory)
A non-plugin aware instance that will always use the same underlying XStream instance with default class loader.- Returns:
- non-plugin aware instance of
DefaultXStreamManager
.
-
postConstruct
@PostConstruct public void postConstruct()
-
fromXML
public Object fromXML(String xml)
Description copied from interface:XStreamManager
Convert the xml into a java Object instance- Specified by:
fromXML
in interfaceXStreamManager
- Parameters:
xml
- The xml representation of the object- Returns:
- The object
-
fromXML
public Object fromXML(String pluginKey, String serializedData)
Description copied from interface:XStreamManager
Convert XML serializedData into an object in the context of plugin referred to by pluginKey.- Specified by:
fromXML
in interfaceXStreamManager
- Parameters:
pluginKey
- plugin key defining the plugin context of the marshalled classserializedData
- XML data- Returns:
- instance of the object represented by the serializedData
-
toXML
public String toXML(Object object)
Description copied from interface:XStreamManager
Convert the java object into its XML form- Specified by:
toXML
in interfaceXStreamManager
- Parameters:
object
- The object- Returns:
- XML representation of the object
-
toXML
public void toXML(Object object, OutputStream outputStream)
Description copied from interface:XStreamManager
Convert the java object into its XML form and stream it to the output stream provided.- Specified by:
toXML
in interfaceXStreamManager
- Parameters:
object
- The objectoutputStream
- stream to write object representation to.
-
-