13693261870
2025-07-02 6708810c4de34dfb9513061432d656f91d56ee3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package com.ruoyi.buss.common.liquor;
 
import javax.tools.SimpleJavaFileObject;
import java.io.IOException;
import java.net.URI;
 
/**
 * This code mainly from: Arthas project
 * */
public class StringSource extends SimpleJavaFileObject {
    private final String contents;
 
    public StringSource(String className, String contents) {
        super(URI.create("string:///" + className.replace('.', '/') + Kind.SOURCE.extension), Kind.SOURCE);
        this.contents = contents;
    }
 
    @Override
    public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
        return contents;
    }
 
}