All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.code.java.compiler.InMemoryJavaSourceFile Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy