/** * Constructs a new JavaSourceFromString. * * @param name * the name of the compilation unit represented by this file * object * @param code * the source code for the compilation unit represented by this * file object */ public StringWrappingJavaFile(String name, String code) { super(getFileUri(name), Kind.SOURCE); this.code = code; }
public CompilationResult compile(final String name, final String src) { return compile(asList(new StringWrappingJavaFile(name, src))); }