mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[xtext generator] fix API compatibility issue (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=399261)
This commit is contained in:
parent
c9a2f51cce
commit
a369aa711f
4 changed files with 46 additions and 25 deletions
|
@ -9,7 +9,6 @@ package org.eclipse.xtext.generator;
|
|||
|
||||
import static com.google.common.collect.Maps.*;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.emf.common.util.URI;
|
||||
|
@ -21,7 +20,7 @@ import com.google.inject.Inject;
|
|||
* @author Sven Efftinge - Initial contribution and API
|
||||
*/
|
||||
public abstract class AbstractFileSystemAccess implements IFileSystemAccess, IFileSystemAccessExtension,
|
||||
IFileSystemAccessExtension2, IFileSystemAccessExtension3 {
|
||||
IFileSystemAccessExtension2 {
|
||||
|
||||
@Inject(optional = true)
|
||||
private IFilePostProcessor postProcessor;
|
||||
|
@ -76,27 +75,6 @@ public abstract class AbstractFileSystemAccess implements IFileSystemAccess, IFi
|
|||
generateFile(fileName, DEFAULT_OUTPUT, contents);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public void generateFile(String fileName, InputStream content) {
|
||||
generateFile(fileName, DEFAULT_OUTPUT, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public InputStream readBinaryFile(String fileName) {
|
||||
return readBinaryFile(fileName, DEFAULT_OUTPUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public CharSequence readTextFile(String fileName) {
|
||||
return readTextFile(fileName, DEFAULT_OUTPUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.1
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2013 itemis AG (http://www.itemis.eu) 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
|
||||
*******************************************************************************/
|
||||
package org.eclipse.xtext.generator;
|
||||
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
*
|
||||
* Abstract base class for file system access supporting {@link IFileSystemAccessExtension3}.
|
||||
*
|
||||
* @author Sven Efftinge - Initial contribution and API
|
||||
* @since 2.4
|
||||
*/
|
||||
public abstract class AbstractFileSystemAccess2 extends AbstractFileSystemAccess implements IFileSystemAccessExtension3{
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public void generateFile(String fileName, InputStream content) {
|
||||
generateFile(fileName, DEFAULT_OUTPUT, content);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public InputStream readBinaryFile(String fileName) {
|
||||
return readBinaryFile(fileName, DEFAULT_OUTPUT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 2.4
|
||||
*/
|
||||
public CharSequence readTextFile(String fileName) {
|
||||
return readTextFile(fileName, DEFAULT_OUTPUT);
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -25,7 +25,7 @@ import com.google.common.io.ByteStreams;
|
|||
* @author Moritz Eysholdt
|
||||
* @since 2.0
|
||||
*/
|
||||
public class InMemoryFileSystemAccess extends AbstractFileSystemAccess {
|
||||
public class InMemoryFileSystemAccess extends AbstractFileSystemAccess2 {
|
||||
|
||||
private Map<String, Object> files = newTreeMap(); // the TreeMap sorts all files by name
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.google.inject.Inject;
|
|||
* @author Jan Koehnlein
|
||||
* @author Moritz Eysholdt
|
||||
*/
|
||||
public class JavaIoFileSystemAccess extends AbstractFileSystemAccess {
|
||||
public class JavaIoFileSystemAccess extends AbstractFileSystemAccess2 {
|
||||
|
||||
@Inject
|
||||
private IEncodingProvider encodingProvider;
|
||||
|
|
Loading…
Reference in a new issue