Jaxb 正在验证queryparam值

Jaxb 正在验证queryparam值,jaxb,jersey,jax-rs,wadl,Jaxb,Jersey,Jax Rs,Wadl,除了下面的方法之外,还有其他方法验证查询参数值吗?例如,有没有一种方法可以通过wadl映射到模式来验证查询参数值。多谢各位 @Path("smooth") @GET public Response smooth( @DefaultValue("blue") @QueryParam("min-color") ColorParam minColor, public class ColorParam extends Color { public ColorParam(String s) {

除了下面的方法之外,还有其他方法验证查询参数值吗?例如,有没有一种方法可以通过wadl映射到模式来验证查询参数值。多谢各位

@Path("smooth")
@GET
public Response smooth(
    @DefaultValue("blue") @QueryParam("min-color") ColorParam minColor,

public class ColorParam extends Color {
 public ColorParam(String s) {
    super(getRGB(s));
 }

 private static int getRGB(String s) {
    if (s.charAt(0) == '#') {
        try {
            Color c = Color.decode("0x" + s.substring(1));
            return c.getRGB();
        } catch (NumberFormatException e) {
            throw new WebApplicationException(400);

不幸的是,当前JAX-RS版本对验证的支持有限。但是,根据研究,它在未来将有更好的验证处理

您可以看到新功能的示例