diff options
Diffstat (limited to 'src/stubs')
-rw-r--r-- | src/stubs/com/sun/tools/javac/code/Symbol.java | 84 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/code/Symtab.java | 20 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/file/BaseFileManager.java | 12 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/main/Arguments.java | 13 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/main/JavaCompiler.java | 37 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/main/Option.java | 1 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/parser/JavacParser.java | 6 | ||||
-rw-r--r-- | src/stubs/com/sun/tools/javac/util/Options.java | 20 |
8 files changed, 192 insertions, 1 deletions
diff --git a/src/stubs/com/sun/tools/javac/code/Symbol.java b/src/stubs/com/sun/tools/javac/code/Symbol.java new file mode 100644 index 00000000..4aef63ad --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symbol.java @@ -0,0 +1,84 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import java.lang.annotation.Annotation; +import java.util.Set; + +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.Element; +import javax.lang.model.element.ElementKind; +import javax.lang.model.element.ElementVisitor; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.Modifier; +import javax.lang.model.element.NestingKind; +import javax.lang.model.element.TypeElement; +import javax.lang.model.element.TypeParameterElement; +import javax.lang.model.element.VariableElement; +import javax.lang.model.type.TypeMirror; + +import com.sun.tools.javac.util.Name; + +public abstract class Symbol implements Element { + public Type type; + public Name name; + + public long flags() { return 0; } + public boolean isStatic() { return false; } + public boolean isConstructor() { return false; } + public boolean isLocal() { return false; } + public Name flatName() { return null; } + public Name getQualifiedName() { return null; } + public <A extends Annotation> A[] getAnnotationsByType(Class<A> annoType) { return null; } + @Override public java.util.List<Attribute.Compound> getAnnotationMirrors() { return null; } + @Override public TypeMirror asType() { return null; } + public <A extends java.lang.annotation.Annotation> A getAnnotation(Class<A> annoType) { return null; } + @Override public Name getSimpleName() { return null; } + @Override public java.util.List<Symbol> getEnclosedElements() { return null; } + @Override public Element getEnclosingElement() { return null; } + + public static abstract class TypeSymbol extends Symbol {} + + public static class MethodSymbol extends Symbol implements ExecutableElement { + public MethodSymbol(long flags, Name name, Type type, Symbol owner) {} + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public java.util.List<? extends TypeParameterElement> getTypeParameters() { return null; } + @Override public TypeMirror getReturnType() { return null; } + @Override public java.util.List<? extends VariableElement> getParameters() { return null; } + @Override public boolean isVarArgs() { return false; } + @Override public java.util.List<? extends TypeMirror> getThrownTypes() { return null; } + @Override public AnnotationValue getDefaultValue() { return null; } + public TypeMirror getReceiverType() { return null; } + public boolean isDefault() { return false; } + public com.sun.tools.javac.util.List<VarSymbol> params() { return null; } + } + + public static class VarSymbol extends Symbol implements VariableElement { + public Type type; + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public Object getConstantValue() { return null; } + } + + public static class ClassSymbol extends TypeSymbol implements TypeElement { + @Override public Name getQualifiedName() { return null; } + @Override public java.util.List<? extends TypeMirror> getInterfaces() { return null; } + @Override public TypeMirror getSuperclass() { return null; } + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public NestingKind getNestingKind() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + @Override public java.util.List<? extends TypeParameterElement> getTypeParameters() { return null; } + } + + // JDK9 + public static class ModuleSymbol extends TypeSymbol { + @Override public ElementKind getKind() { return null; } + @Override public Set<Modifier> getModifiers() { return null; } + @Override public <R, P> R accept(ElementVisitor<R, P> v, P p) { return null; } + } +} diff --git a/src/stubs/com/sun/tools/javac/code/Symtab.java b/src/stubs/com/sun/tools/javac/code/Symtab.java new file mode 100644 index 00000000..2b524e4c --- /dev/null +++ b/src/stubs/com/sun/tools/javac/code/Symtab.java @@ -0,0 +1,20 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.code; + +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Symbol.ModuleSymbol; +import com.sun.tools.javac.util.Context; + +public class Symtab { + // Shared by JDK6-9 + public ClassSymbol methodClass; + public Type iterableType; + public Type objectType; + public static Symtab instance(Context context) {return null;} + public Type unknownType; + + // JDK 9 + public ModuleSymbol unnamedModule; +} diff --git a/src/stubs/com/sun/tools/javac/file/BaseFileManager.java b/src/stubs/com/sun/tools/javac/file/BaseFileManager.java index 7a2293d5..a56a2430 100644 --- a/src/stubs/com/sun/tools/javac/file/BaseFileManager.java +++ b/src/stubs/com/sun/tools/javac/file/BaseFileManager.java @@ -5,4 +5,14 @@ package com.sun.tools.javac.file; import javax.tools.JavaFileManager; -public abstract class BaseFileManager implements JavaFileManager{} +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.util.Context; + +import java.nio.charset.Charset; +import java.util.Map; + +public abstract class BaseFileManager implements JavaFileManager { + protected BaseFileManager(Charset charset) {} + public void setContext(Context context) {} + public boolean handleOptions(Map<Option, String> deferredFileManagerOptions) { return false; } +} diff --git a/src/stubs/com/sun/tools/javac/main/Arguments.java b/src/stubs/com/sun/tools/javac/main/Arguments.java new file mode 100644 index 00000000..ea866b6e --- /dev/null +++ b/src/stubs/com/sun/tools/javac/main/Arguments.java @@ -0,0 +1,13 @@ +package com.sun.tools.javac.main; + +import java.util.Map; + +import com.sun.tools.javac.util.Context; + +public class Arguments { + public static final Context.Key<Arguments> argsKey = new Context.Key<Arguments>(); + public static Arguments instance(Context context) { return null; } + public void init(String ownName, String... argv) {} + public Map<Option, String> getDeferredFileManagerOptions() { return null; } + public boolean validate() { return false; } +} diff --git a/src/stubs/com/sun/tools/javac/main/JavaCompiler.java b/src/stubs/com/sun/tools/javac/main/JavaCompiler.java new file mode 100644 index 00000000..d0e7b38f --- /dev/null +++ b/src/stubs/com/sun/tools/javac/main/JavaCompiler.java @@ -0,0 +1,37 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ +package com.sun.tools.javac.main; + +import java.io.IOException; +import java.util.Collection; +import javax.annotation.processing.Processor; +import javax.tools.JavaFileObject; + +import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.List; +import com.sun.tools.javac.comp.Todo; + +public class JavaCompiler { + // Shared by JDK6-9 + public boolean keepComments; + public boolean genEndPos; + public Todo todo; + + public JavaCompiler(Context context) {} + public int errorCount() { return 0; } + public static String version() { return "<stub>"; } + public JCCompilationUnit parse(String fileName) throws IOException { return null; } + public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots) {return null;} + + //JDK up to 8 + public void initProcessAnnotations(Iterable<? extends Processor> processors) throws IOException {} + public JavaCompiler processAnnotations(List<JCCompilationUnit> roots, List<String> classnames) {return this;} + + // JDK 9 + public void initProcessAnnotations(Iterable<? extends Processor> processors, Collection<? extends JavaFileObject> initialFiles, Collection<String> initialClassNames) {} + public void processAnnotations(List<JCCompilationUnit> roots, Collection<String> classnames) {} + public void close() {} + public List<JCCompilationUnit> initModules(List<JCCompilationUnit> roots) { return null; } +} diff --git a/src/stubs/com/sun/tools/javac/main/Option.java b/src/stubs/com/sun/tools/javac/main/Option.java index f3229c78..ae955772 100644 --- a/src/stubs/com/sun/tools/javac/main/Option.java +++ b/src/stubs/com/sun/tools/javac/main/Option.java @@ -7,4 +7,5 @@ package com.sun.tools.javac.main; public enum Option { ; public String text; + public String primaryName; } diff --git a/src/stubs/com/sun/tools/javac/parser/JavacParser.java b/src/stubs/com/sun/tools/javac/parser/JavacParser.java index da42f37a..4f1f3380 100644 --- a/src/stubs/com/sun/tools/javac/parser/JavacParser.java +++ b/src/stubs/com/sun/tools/javac/parser/JavacParser.java @@ -1,3 +1,6 @@ +/* + * These are stub versions of various bits of javac-internal API (for various different versions of javac). Lombok is compiled against these. + */ package com.sun.tools.javac.parser; import com.sun.tools.javac.tree.JCTree; @@ -6,6 +9,9 @@ public class JavacParser { protected JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap, boolean keepEndPositions) { } + protected JavacParser(ParserFactory fac, Lexer S, boolean keepDocComments, boolean keepLineMap, boolean keepEndPositions, boolean parseModuleInfo) { + } + public JCTree.JCCompilationUnit parseCompilationUnit() { return null; } diff --git a/src/stubs/com/sun/tools/javac/util/Options.java b/src/stubs/com/sun/tools/javac/util/Options.java new file mode 100644 index 00000000..e7ba8960 --- /dev/null +++ b/src/stubs/com/sun/tools/javac/util/Options.java @@ -0,0 +1,20 @@ +package com.sun.tools.javac.util; + +import java.util.Set; + +import com.sun.tools.javac.main.Option; +import com.sun.tools.javac.main.OptionName; +import com.sun.tools.javac.main.JavacOption; + +public class Options { + public Options(Context context) {} + public static final Context.Key<Options> optionsKey = new Context.Key<Options>(); + public static Options instance(Context context) { return null; } + public String get(String key) { return null; } + public String get(Option opt) { return null; } + public String get(OptionName name) { return null; } + public String get(JavacOption.Option opt) { return null; } + public void putAll(Options o) {} + public void put(String key, String value) {} + public Set<String> keySet() { return null; } +} |