Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » impossible to serialize object in xml launch configs in 3.1 RC3
impossible to serialize object in xml launch configs in 3.1 RC3 [message #287262] Tue, 28 June 2005 14:49
Sébastien  Gandon is currently offline Sébastien GandonFriend
Messages: 184
Registered: July 2009
Senior Member
Hi, there
I need to serialize an object in a launch XML configuration.
I tried to use the ILaunchConfigurationWorkingCopy.setAttribute(String,
String) but it does not seem to work I cannot manage to deserialize my
classes.
Please tell me how can I do this?

SeB.

the code I use to serialize my object
------------------------------------------------------------ --
public void storesSignalingInstanceTo(ILaunchConfigurationWorkingCopy
configuration) throws IOException {
ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);
try {
getSignalingType().serializeSignalingInstance(bos);
bos.flush();
configuration.setAttribute(MhdkSignalingTab.ATTR_SIGNALING_S ERIALIZED_INSTANCE,
bos.toString());
}catch (Exception e) {
//wrap all exceptions in a IOException
IOException ioe = new IOException("could not serialize signaling
instance"); //$NON-NLS-1$
ioe.initCause(e);
throw ioe;
}
}

the code I use to deserialize my object
------------------------------------------------------------ --
public Signaling restoreSignalingInstanceFrom(ILaunchConfiguration
configuration) throws CoreException, IOException{
String serializedInst =
configuration.getAttribute(MhdkSignalingTab.ATTR_SIGNALING_S ERIALIZED_INSTANCE,
(String) null);
InputStream is = new ByteArrayInputStream(serializedInst.getBytes());
//$NON-NLS-1$
try {
return getSignalingType().deserializeSignalingInstance(is);
} catch (Exception e) {
IOException ioe = new IOException("could not deserialize signaling
instance"); //$NON-NLS-1$
ioe.initCause(e);
throw ioe;
}
}
Previous Topic:Import/Adding a PlugIn
Next Topic:PROBLEM WITH A WIZARD
Goto Forum:
  


Current Time: Fri Aug 16 20:47:48 GMT 2024

Powered by FUDForum. Page generated in 0.04495 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top