是否可以更多地实现带注释的REST接口,以便应用程序。服务器决定使用哪种实现,例如关于它的@Priority?
示例:
@Path("endpoint")
public interface Endpoint {
@GET("{id}")
RetVal get(Integer id);
}
@Priority(100)
public class EndpointImpl implements Endpoint {
RetVal get(Integer id) {
return new RetVal();
}
}
@Priority(200)
public class ExtendedEndpointImpl implements Endpoint {
ExtendedRetVal get(Integer id) {
return new ExtendedRetVal(); // class ExtendedRetVal extends RetVal
}
}