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

org.mdkt.compiler.SourceCode Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package org.mdkt.compiler;

import javax.tools.SimpleJavaFileObject;
import java.io.IOException;
import java.net.URI;

/**
 * Created by trung on 5/3/15.
 */
public class SourceCode extends SimpleJavaFileObject {
    private String contents = null;

    public SourceCode(String className, String contents) throws Exception {
        super(URI.create("string:///" + className.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE);
        this.contents = contents;
    }

    public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
        return contents;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy