com.softicar.platform.common.code.java.compiler.InMemoryJavaSourceFile Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of platform-common Show documentation
Show all versions of platform-common Show documentation
The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.
package com.softicar.platform.common.code.java.compiler;
import com.softicar.platform.common.core.java.classes.name.JavaClassName;
import java.io.InputStream;
import java.io.OutputStream;
import javax.tools.JavaFileObject;
/**
* This is an in-memory implementation of {@link JavaFileObject} for Java source
* code.
*
* @author Oliver Richers
*/
class InMemoryJavaSourceFile extends AbstractInMemoryJavaFile {
private final CharSequence sourceCode;
public InMemoryJavaSourceFile(JavaClassName className, CharSequence sourceCode) {
super(className, Kind.SOURCE);
this.sourceCode = sourceCode;
}
@Override
public CharSequence getCharContent(boolean ignoreEncodingErrors) {
return sourceCode;
}
@Override
public InputStream openInputStream() {
throw new UnsupportedOperationException();
}
@Override
public OutputStream openOutputStream() {
throw new UnsupportedOperationException();
}
}