1 10 11 package com.sun.source.util; 12 13 import com.sun.source.tree.CompilationUnitTree; 14 import javax.lang.model.element.TypeElement; 15 import javax.tools.JavaFileObject; 16 17 23 public final class TaskEvent 24 { 25 29 public enum Kind { 30 33 PARSE, 34 37 ENTER, 38 41 ANALYZE, 42 45 GENERATE, 46 49 ANNOTATION_PROCESSING, 50 53 ANNOTATION_PROCESSING_ROUND 54 }; 55 56 public TaskEvent(Kind kind) { 57 this(kind, null, null, null); 58 } 59 60 public TaskEvent(Kind kind, JavaFileObject sourceFile) { 61 this(kind, sourceFile, null, null); 62 } 63 64 public TaskEvent(Kind kind, CompilationUnitTree unit) { 65 this(kind, unit.getSourceFile(), unit, null); 66 } 67 68 public TaskEvent(Kind kind, CompilationUnitTree unit, TypeElement clazz) { 69 this(kind, unit.getSourceFile(), unit, clazz); 70 } 71 72 private TaskEvent(Kind kind, JavaFileObject file, CompilationUnitTree unit, TypeElement clazz) { 73 this.kind = kind; 74 this.file = file; 75 this.unit = unit; 76 this.clazz = clazz; 77 } 78 79 public Kind getKind() { 80 return kind; 81 } 82 83 public JavaFileObject getSourceFile() { 84 return file; 85 } 86 87 public CompilationUnitTree getCompilationUnit() { 88 return unit; 89 } 90 91 public TypeElement getTypeElement() { 92 return clazz; 93 } 94 95 public String toString() { 96 return "TaskEvent[" 97 + kind + "," 98 + file + "," 99 + clazz + "]"; 101 } 102 103 private Kind kind; 104 private JavaFileObject file; 105 private CompilationUnitTree unit; 106 private TypeElement clazz; 107 } 108 | Popular Tags |