How I can do custom Java annotation with no attribute name inside parentheses?
I don't want this: @annotation_name(att=valor)
. I just want like in Servlets, i.e:
@WebServlet("/main")
Define the annotation with an attribute named value
, then the attribute name can be omitted:
@interface CustomAnnotation
{
String value();
}
This can be used like so:
@CustomAnnotation("/main")
// ...