-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJavaCompilationUtils.java
94 lines (80 loc) · 3.81 KB
/
JavaCompilationUtils.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*
* Copyright (C) 2020 Bence Sipka
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package saker.java.compiler.jdk.impl;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.NavigableMap;
import java.util.TreeMap;
import javax.lang.model.element.Element;
import javax.lang.model.element.ElementKind;
import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;
import javax.lang.model.util.Elements;
import javax.tools.JavaFileManager;
import javax.tools.StandardJavaFileManager;
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.Tree;
import com.sun.source.util.TreePath;
import com.sun.source.util.Trees;
import saker.java.compiler.impl.JavaTaskUtils;
import saker.java.compiler.impl.compile.file.IncrementalDirectoryPaths;
import saker.java.compiler.impl.compile.handler.info.RealizedSignatureData;
import saker.java.compiler.impl.compile.handler.invoker.CompilationContextInformation;
import saker.java.compiler.impl.compile.signature.parser.ParserCache;
import saker.java.compiler.impl.signature.element.ClassSignature;
import saker.java.compiler.impl.signature.element.ModuleSignature;
import saker.java.compiler.impl.signature.element.PackageSignature;
import saker.java.compiler.jdk.impl.incremental.model.IncrementalElementsTypes;
import saker.java.compiler.jdk.impl.parser.signature.CompilationUnitSignatureParser;
import saker.java.compiler.jdk.impl.parser.usage.AbiUsageParser;
import saker.java.compiler.util8.impl.Java8LanguageUtils;
import saker.java.compiler.util8.impl.file.IncrementalJavaFileManager8;
import saker.build.thirdparty.saker.rmi.connection.RMITransferProperties;
public class JavaCompilationUtils {
private JavaCompilationUtils() {
throw new UnsupportedOperationException();
}
public static CompilationUnitSignatureParser createSignatureParser(Trees trees, String srcver, ParserCache cache) {
return new CompilationUnitSignatureParser(trees, srcver, cache);
}
public static AbiUsageParser createAbiUsageParser(Trees trees, String srcver, ParserCache cache) {
return new AbiUsageParser(trees, srcver, cache);
}
public static IncrementalElementsTypes createElementsTypes(Elements realelements, Object javacsync,
CompilationContextInformation context, ParserCache cache) {
return new IncrementalElementsTypes(realelements, javacsync, cache, context);
}
public static RealizedSignatureData getRealizedSignatures(CompilationUnitTree unit, Trees trees, String filename,
ParserCache cache) {
return Java8LanguageUtils.getRealizedSignatures(unit, trees, filename, cache);
}
public static JavaFileManager createFileManager(StandardJavaFileManager stdfilemanager,
IncrementalDirectoryPaths directorypaths) {
return new IncrementalJavaFileManager8(stdfilemanager, directorypaths);
}
public static void applyRMIProperties(RMITransferProperties.Builder propertiesbuilder) {
Java8LanguageUtils.applyRMIProperties(propertiesbuilder);
}
public static String getModuleNameOf(Element elem) {
return null;
}
public static List<? extends TypeMirror> getPermittedSubclasses(TypeElement elem) {
return Collections.emptyList();
}
}