CompilationParticipant
, the simpler problem interface IProblem
did not carry enough information to better separate and categorize Java problems. In order to minimize impact on existing API, Java problems are still passed around as IProblem
, though actual implementations should explicitly extend CategorizedProblem
. Participants can produce their own problem definitions, and given these are categorized problems, they can be better handled by clients (such as user interface). A categorized problem provides access to: IProblem
, IProblem
for backward compatibility reason. It is intended that CategorizedProblem
will be subclassed for custom problem implementation when participating in compilation operations, so as to allow participant to contribute their own marker types, and thus defining their own domain specific problem/category IDs. Note: standard Java problems produced by Java default tooling will set the marker IMarker#GENERATED_BY attribute to JavaBuilder#GENERATED_BY; compiler participants may specify the IMarker#GENERATED_BY attribute of their markers by adding it to the extra marker attributes of the problems they generate; markers resulting from compiler participants' problems that do not have the IMarker#GENERATED_BY extra attribute set do not have the IMarker#GENERATED_BY attribute set either.
@since 3.2
org.eclipse.jdt.core.compiler.CompilationParticipant
, the simpler problem interface {@link IProblem} did not carry enough information to betterseparate and categorize Java problems. In order to minimize impact on existing API, Java problems are still passed around as {@link IProblem}, though actual implementations should explicitly extend {@link CategorizedProblem}. Participants can produce their own problem definitions, and given these are categorized problems, they can be better handled by clients (such as user interface). A categorized problem provides access to:
Note: the compiler produces IProblems internally, which are turned into markers by the JavaBuilder so as to persist problem descriptions. This explains why there is no API allowing to reach IProblem detected when compiling. However, the Java problem markers carry equivalent information to IProblem, in particular their ID (attribute "id") is set to one of the IDs defined on this interface.
Note: Standard Java problems produced by Java default tooling will be subclasses of this class. Technically, most API methods dealing with problems are referring to {@link IProblem} for backward compatibility reason.It is intended that {@link CategorizedProblem} will be subclassed for custom problem implementation whenparticipating in compilation operations, so as to allow participant to contribute their own marker types, and thus defining their own domain specific problem/category IDs.
Note: standard Java problems produced by Java default tooling will set the marker IMarker#SOURCE_ID
attribute to JavaBuilder#SOURCE_ID
; compiler participants may specify the IMarker#SOURCE_ID
attribute of their markers by adding it to the extra marker attributes of the problems they generate; markers resulting from compiler participants' problems that do not have the IMarker#SOURCE_ID
extra attribute set do not have the JavaBuilder#SOURCE_ID
attribute set either.
@since 3.2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|