blob: 5845369ad98eeb9736f088c2301bc82e4d314ee2 (
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
|
/*******************************************************************************
* Copyright (c) 2005, 2007 committers of openArchitectureWare 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:
* committers of openArchitectureWare - initial API and implementation
*******************************************************************************/
package org.eclipse.xpand.internal.tests.evaluate;
import org.eclipse.internal.xtend.expression.ast.SyntaxElement;
import org.eclipse.xpand2.XpandExecutionContext;
import org.eclipse.xpand2.output.Outlet;
import org.eclipse.xpand2.output.Output;
/**
* *
*
* @author Sven Efftinge (http://www.efftinge.de) *
*/
public class OutputStringImpl implements Output {
StringBuffer buff = new StringBuffer();
public void write(final byte[] bytes) {
buff.append(new String(bytes));
}
public void write(final String string) {
buff.append(string);
}
private SyntaxElement curr = null;
public void pushStatement(final SyntaxElement stmt,XpandExecutionContext ctx) {
curr = stmt;
}
public SyntaxElement popStatement() {
return curr;
}
@Override
public String toString() {
return buff.toString();
}
public void openFile(final String path, final String fileMode) {
// TODO Auto-generated method stub
}
public void closeFile() {
// TODO Auto-generated method stub
}
public void setFileEncoding(final String encoding) {
// TODO Auto-generated method stub
}
public void addOutlet(Outlet outlet) {
throw new UnsupportedOperationException("This implementation does not support outlets");
}
public Outlet getOutlet(String name) {
throw new UnsupportedOperationException("This implementation does not support outlets");
}
}
|