Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 109ad5a03821c7dea991594c2fa3688b2285796f (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
72
73
74
75
76
77
78
79
80
81
82
/*******************************************************************************
 * Copyright (c) 2000, 2018 IBM Corporation 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:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.text.templates.persistence;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
import java.util.ResourceBundle;


/**
 * Serializes templates as character or byte stream and reads the same format
 * back.
 * <p>
 * Clients may instantiate this class, it is not intended to be
 * subclassed.</p>
 *
 * @since 3.0
 * @noextend This class is not intended to be subclassed by clients.
 * @deprecated See {@link org.eclipse.text.templates.TemplateReaderWriter}
 */
@Deprecated
public class TemplateReaderWriter extends org.eclipse.text.templates.TemplateReaderWriter {

	public TemplateReaderWriter() {
	}

	@Override
	public TemplatePersistenceData[] read(Reader reader) throws IOException {
		org.eclipse.text.templates.TemplatePersistenceData[] list= super.read(reader);
		TemplatePersistenceData[] result= new TemplatePersistenceData[list.length];
		for (int i= 0; i < list.length; i++) {
			result[i]= new TemplatePersistenceData(list[i]);
		}
		return result;
	}

	@Override
	public TemplatePersistenceData readSingle(Reader reader, String id) throws IOException {
		return new org.eclipse.jface.text.templates.persistence.TemplatePersistenceData(super.readSingle(reader, id));
	}

	@Override
	public TemplatePersistenceData[] read(Reader reader, ResourceBundle bundle) throws IOException {
		org.eclipse.text.templates.TemplatePersistenceData[] list= super.read(reader, bundle);
		TemplatePersistenceData[] result= new TemplatePersistenceData[list.length];
		for (int i= 0; i < list.length; i++) {
			result[i]= new TemplatePersistenceData(list[i]);
		}
		return result;
	}

	@Override
	public TemplatePersistenceData[] read(InputStream stream, ResourceBundle bundle) throws IOException {
		org.eclipse.text.templates.TemplatePersistenceData[] list= super.read(stream, bundle);
		TemplatePersistenceData[] result= new TemplatePersistenceData[list.length];
		for (int i= 0; i < list.length; i++) {
			result[i]= new TemplatePersistenceData(list[i]);
		}
		return result;
	}

	public void save(TemplatePersistenceData[] templates, OutputStream stream) throws IOException {
		super.save(templates, stream);
	}

	public void save(TemplatePersistenceData[] templates, Writer writer) throws IOException {
		super.save(templates, writer);
	}

}

Back to the top