I have couple of annotations on a getter as below. I would like to skip all the annotations call on the getter based on a boolean in the same class. Is there any way to do it?
@MyAnnotation1(message = "{someMessage1}")
@MyAnnotation2(message = "{someMessage2}")
public Date getFromDate() {
return fromDate;
}
You can define another annotation as
@Ignoreon that field if that annotated field is set you can simply ignore your annotation processing.You can define your own annotation as
Remember this is custom annotation so you will need to write code to handle it
PS Note: Assuming you are writing custom annotations. And there processing.