When I have an Interface, for example:
public interface Model {
String toString();
}
And I want that every class that implements this Interface will use the following Annotations:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
So it will look like this in the Interface:
@XmlRootElement
@XmlAccessorType(XmlAccessType.FIELD)
public interface Model {
String toString();
}
And a test class:
@XmlRootElement(name = "user")
public class User implements Model {
}
Something like this example doesn't work. How can I perform that, an abstract class with the annotations is maybe the solution?
Thank you in advance!