Package javax.validation.constraints

Examples of javax.validation.constraints.Size.max()


        else
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH_DEFAULT, minimum);
        }

        int maximum = annotation.max();
        if(maximum != Integer.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.MAX_LENGTH, maximum);
        }
        else
View Full Code Here


        prop.setNullable(false);
      }

      Size size = get(prop, Size.class);
      if (size != null) {
        if (size.max() < Integer.MAX_VALUE) {
          // explicitly specify a version column
          prop.setDbLength(size.max());
        }
      }
    }
View Full Code Here

      Size size = get(prop, Size.class);
      if (size != null) {
        if (size.max() < Integer.MAX_VALUE) {
          // explicitly specify a version column
          prop.setDbLength(size.max());
        }
      }
    }

    EmbeddedColumns columns = get(prop, EmbeddedColumns.class);
View Full Code Here

    }
    else {
      // try Size anno
      final Size aSize = m.getAnnotation(Size.class);
      if(aSize != null) {
        maxlen = aSize.max();
      }
    }

    if(rt == String.class) {
      maxlen = maxlen == -1 ? 255 : maxlen;
View Full Code Here

        Annotation constraint = constraintDescriptor.getAnnotation();
       
        if (!isMaxlenghtSet(input)) {
            if (constraint.annotationType().equals(Size.class)) {
                Size size = (Size) constraint;
                if (size.max() > 0) {
                    setMaxlength(input, size.max());
                }
            }
        }
       
View Full Code Here

       
        if (!isMaxlenghtSet(input)) {
            if (constraint.annotationType().equals(Size.class)) {
                Size size = (Size) constraint;
                if (size.max() > 0) {
                    setMaxlength(input, size.max());
                }
            }
        }
       
        if (!editableValueHolder.isRequired()) {
View Full Code Here

    }
    else {
      // try Size anno
      final Size aSize = m.getAnnotation(Size.class);
      if(aSize != null) {
        maxlen = aSize.max();
      }
    }

    if(rt == String.class) {
      maxlen = maxlen == -1 ? 255 : maxlen;
View Full Code Here

        else
        {
            results.put(CommonMetaDataKeys.MIN_LENGTH_DEFAULT, minimum);
        }

        int maximum = annotation.max();
        if(maximum != Integer.MAX_VALUE)
        {
            results.put(CommonMetaDataKeys.MAX_LENGTH, maximum);
        }
        else
View Full Code Here

  public void modify(FormComponent<?> component, ComponentTag tag, Size annotation)
  {
    if ("input".equalsIgnoreCase(tag.getName()))
    {
      Size size = (Size)annotation;
      tag.put("maxlen", size.max());
    }
  }
}
View Full Code Here

            Size size = (Size) annotation;
            if (size.min() > 0) {
                sb.append("required: true, \n");
            }
            sb.append("minlength: ").append(size.min()).append(",\n");
            sb.append("maxlength: ").append(size.max());
        } else if (annotation instanceof Size.List) {
            // Defines several @Size annotations on the same element
            throw new UnsupportedOperationException("Not implemented");
        }
        return sb.toString();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.