1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package com.ochafik.lang.compiler;
20
21 import javax.lang.model.element.Modifier;
22 import javax.lang.model.element.NestingKind;
23 import javax.tools.JavaFileObject;
24
25 public class MemoryJavaFile extends MemoryFileObject implements JavaFileObject {
26 JavaFileObject.Kind kind;
27 public MemoryJavaFile(String path, String content, JavaFileObject.Kind kind) {
28 super(path, content);
29 this.kind = kind;
30 }
31 public Modifier getAccessLevel() {
32 return Modifier.PUBLIC;
33 }
34 public JavaFileObject.Kind getKind() {
35 return kind;
36 }
37 public NestingKind getNestingKind() {
38 return null;
39 }
40 public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) {
41 return true;
42 }
43
44 }