String literal as error

I'm creating custom reference providers for some annotation attribute which is java.lang.String.
Unlike JSP when my reference returns null as result of resolve() method - it ain't shown as error in Java class.
Plz give some advice how is correct way to make certain string literal in java class as error, i.e. highlight it and prevent from compile.

0
2 comments
Avatar
Permanently deleted user

I'm creating custom reference providers for some annotation attribute which is java.lang.String.
Unlike JSP when my reference returns null as result of resolve() method - it ain't shown as error in Java class.
Plz give some advice how is correct way to make certain string literal in java class as error, i.e. highlight it and prevent from compile.


You should implement custom highlighter for your reference, either
Annotator or LocalInspectionTool. And to prevent from compilation,
you'll need to create your own validating compiler or use existing
InspectionValidator.

0
Avatar
Permanently deleted user

Thnx for advice !

0

Please sign in to leave a comment.