Top Description Inners Fields Constructors Methods
com.sun.source.util

public final Class TaskEvent

extends Object
Class Inheritance
Imports
javax.lang.model.element.TypeElement, javax.tools.JavaFileObject, com.sun.source.tree.CompilationUnitTree

Provides details about work that has been done by the JDK Java Compiler, javac.
Author
Jonathan Gibbons
Since
1.6

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
TaskEvent.Kind

Kind of task event.

Field Summary

Modifier and TypeField and Description
private TypeElement
private JavaFileObject
private TaskEvent.Kind
private CompilationUnitTree

Constructor Summary

AccessConstructor and Description
public
TaskEvent(TaskEvent.Kind
the kind of the event
kind
)

Creates a task event for a given kind.

public
TaskEvent(TaskEvent.Kind
the kind of the event
kind
,
JavaFileObject
the source file
sourceFile
)

Creates a task event for a given kind and source file.

public
TaskEvent(TaskEvent.Kind
the kind of the event
kind
,
CompilationUnitTree
the compilation unit
unit
)

Creates a task event for a given kind and compilation unit.

public
TaskEvent(TaskEvent.Kind
the kind of the event
kind
,
CompilationUnitTree
the compilation unit
unit
,
TypeElement
the type element
clazz
)

Creates a task event for a given kind, compilation unit and type element.

private

Method Summary

Modifier and TypeMethod and Description
public CompilationUnitTree

Returns:

the compilation unit
getCompilationUnit
()

Returns the compilation unit for this event.

public TaskEvent.Kind

Returns:

the kind
getKind
()

Returns the kind for this event.

public JavaFileObject

Returns:

the source file
getSourceFile
()

Returns the source file for this event.

public TypeElement

Returns:

the type element
getTypeElement
()

Returns the type element for this event.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

clazzback to summary
private TypeElement clazz
fileback to summary
private JavaFileObject file
kindback to summary
private TaskEvent.Kind kind
unitback to summary
private CompilationUnitTree unit

Constructor Detail

TaskEventback to summary
public TaskEvent(TaskEvent.Kind kind)

Creates a task event for a given kind. The source file, compilation unit and type element are all set to null.

Parameters
kind:TaskEvent.Kind

the kind of the event

TaskEventback to summary
public TaskEvent(TaskEvent.Kind kind, JavaFileObject sourceFile)

Creates a task event for a given kind and source file. The compilation unit and type element are both set to null.

Parameters
kind:TaskEvent.Kind

the kind of the event

sourceFile:JavaFileObject

the source file

TaskEventback to summary
public TaskEvent(TaskEvent.Kind kind, CompilationUnitTree unit)

Creates a task event for a given kind and compilation unit. The source file is set from the compilation unit, and the type element is set to null.

Parameters
kind:TaskEvent.Kind

the kind of the event

unit:CompilationUnitTree

the compilation unit

TaskEventback to summary
public TaskEvent(TaskEvent.Kind kind, CompilationUnitTree unit, TypeElement clazz)

Creates a task event for a given kind, compilation unit and type element. The source file is set from the compilation unit.

Parameters
kind:TaskEvent.Kind

the kind of the event

unit:CompilationUnitTree

the compilation unit

clazz:TypeElement

the type element

TaskEventback to summary
private TaskEvent(TaskEvent.Kind kind, JavaFileObject file, CompilationUnitTree unit, TypeElement clazz)

Method Detail

getCompilationUnitback to summary
public CompilationUnitTree getCompilationUnit()

Returns the compilation unit for this event. May be null.

Returns:CompilationUnitTree

the compilation unit

getKindback to summary
public TaskEvent.Kind getKind()

Returns the kind for this event.

Returns:TaskEvent.Kind

the kind

getSourceFileback to summary
public JavaFileObject getSourceFile()

Returns the source file for this event. May be null.

Returns:JavaFileObject

the source file

getTypeElementback to summary
public TypeElement getTypeElement()

Returns the type element for this event. May be null.

Returns:TypeElement

the type element

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
com.sun.source.util back to summary

public final Enum TaskEvent.Kind

extends Enum<TaskEvent.Kind>
Class Inheritance

Kind of task event.
Since
1.6

Field Summary

Modifier and TypeField and Description
public static final TaskEvent.Kind
ANALYZE

For events relating to elements being analyzed for errors.

public static final TaskEvent.Kind
ANNOTATION_PROCESSING

For events relating to overall annotation processing.

public static final TaskEvent.Kind
ANNOTATION_PROCESSING_ROUND

For events relating to an individual annotation processing round.

public static final TaskEvent.Kind
COMPILATION

Sent before parsing first source file, and after writing the last output file.

public static final TaskEvent.Kind
ENTER

For events relating to elements being entered.

public static final TaskEvent.Kind
GENERATE

For events relating to class files being generated.

public static final TaskEvent.Kind
PARSE

For events related to the parsing of a file.

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

Modifier and TypeMethod and Description
public static TaskEvent.Kind
public static TaskEvent.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

ANALYZEback to summary
public static final TaskEvent.Kind ANALYZE

For events relating to elements being analyzed for errors.

ANNOTATION_PROCESSINGback to summary
public static final TaskEvent.Kind ANNOTATION_PROCESSING

For events relating to overall annotation processing.

ANNOTATION_PROCESSING_ROUNDback to summary
public static final TaskEvent.Kind ANNOTATION_PROCESSING_ROUND

For events relating to an individual annotation processing round.

COMPILATIONback to summary
public static final TaskEvent.Kind COMPILATION

Sent before parsing first source file, and after writing the last output file. This event is not sent when using JavacTask#parse(), JavacTask#analyze() or JavacTask#generate().

Since
9
ENTERback to summary
public static final TaskEvent.Kind ENTER

For events relating to elements being entered.

GENERATEback to summary
public static final TaskEvent.Kind GENERATE

For events relating to class files being generated.

PARSEback to summary
public static final TaskEvent.Kind PARSE

For events related to the parsing of a file.

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static TaskEvent.Kind valueOf(String name)
valuesback to summary
public static TaskEvent.Kind[] values()