blob: e7f1a854ce68b86ed6b214cce635a13716095844 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
/*******************************************************************************
* Copyright (c) 2012 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Wind River Systems - initial API and implementation
*******************************************************************************/
package org.eclipse.tcf.te.launch.core.internal;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.tcf.te.launch.core.lm.interfaces.ILaunchSpecification;
import org.eclipse.tcf.te.runtime.persistence.GsonMapPersistenceDelegate;
import org.eclipse.tcf.te.runtime.services.interfaces.filetransfer.IFileTransferItem;
/**
* Launch Specification to string delegate implementation.
*/
public class GsonLaunchSpecPersistenceDelegate extends GsonMapPersistenceDelegate {
/**
* Constructor.
*/
public GsonLaunchSpecPersistenceDelegate() {
super();
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.persistence.interfaces.IPersistenceDelegate#getPersistedClass(java.lang.Object)
*/
@Override
public Class<?> getPersistedClass(Object context) {
return ILaunchSpecification.class;
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesPersistenceDelegate#toMap(java.lang.Object)
*/
@Override
protected Map<String, Object> toMap(final Object context) throws IOException {
return new HashMap<String, Object>();
}
/* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.persistence.AbstractPropertiesPersistenceDelegate#fromMap(java.util.Map, java.lang.Object)
*/
@Override
protected Object fromMap(Map<String, Object> map, Object context) throws IOException {
return null;
}
/**
* Get a file transfer item from the given context.
*
* @param context The context. Must not be <code>null</code>.
* @return The file transfer item or <code>null</code>.
*/
protected IFileTransferItem getFileTransferItem(Object context) {
IFileTransferItem item = null;
if (context instanceof IFileTransferItem) {
item = (IFileTransferItem)context;
}
return item;
}
}
|