/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { return BeanValidationUtils.isNotNull(this); }
public String getConstraints() { return BeanValidationUtils.describeConstraints(this.accessor, this.accessor instanceof Element && ((Element) this.accessor).isRequired()); }
@Override public Map<String, String> getPropertyMetadata() { Map<String, String> propertyMetadata = new LinkedHashMap<String, String>(); boolean showConstraints = false; boolean showDefaultValue = false; for (Member member : this.typeDefinition.getMembers()) { if (BeanValidationUtils.hasConstraints(member, member.isRequired())) { showConstraints = true; } if (member.getDefaultValue() != null) { showDefaultValue = true; } } if (showConstraints) { propertyMetadata.put("constraints", "constraints"); } if (showDefaultValue) { propertyMetadata.put("defaultValue", "default"); } return propertyMetadata; }
@Override public Map<String, String> getPropertyMetadata() { Map<String, String> propertyMetadata = new LinkedHashMap<String, String>(); boolean showRequired = false; boolean showDefaultValue = false; for (Member member : this.typeDefinition.getMembers()) { if (BeanValidationUtils.hasConstraints(member, member.isRequired())) { showRequired = true; } if (member.getDefaultValue() != null) { showDefaultValue = true; } } if (showRequired) { propertyMetadata.put("constraints", "constraints"); } if (showDefaultValue) { propertyMetadata.put("defaultValue", "default"); } return propertyMetadata; }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { return BeanValidationUtils.isNotNull(this); }
public String getConstraints() { return BeanValidationUtils.describeConstraints(member, isRequired()); }
@Override public Map<String, String> getPropertyMetadata() { Map<String, String> propertyMetadata = new LinkedHashMap<String, String>(); boolean showConstraints = false; boolean showDefaultValue = false; for (Member member : this.typeDefinition.getMembers()) { if (BeanValidationUtils.hasConstraints(member, member.isRequired())) { showConstraints = true; } if (member.getDefaultValue() != null) { showDefaultValue = true; } } if (showConstraints) { propertyMetadata.put("constraints", "constraints"); } if (showDefaultValue) { propertyMetadata.put("defaultValue", "default"); } return propertyMetadata; }
public static boolean isNotNull(Element el) { return isNotNull(el, true); }
public String getConstraints() { return BeanValidationUtils.describeConstraints(member, isRequired()); }
@Override public Map<String, String> getPropertyMetadata() { Map<String, String> propertyMetadata = new LinkedHashMap<String, String>(); boolean showRequired = false; boolean showDefaultValue = false; for (Member member : this.typeDefinition.getMembers()) { if (BeanValidationUtils.hasConstraints(member, member.isRequired())) { showRequired = true; } if (member.getDefaultValue() != null) { showDefaultValue = true; } } if (showRequired) { propertyMetadata.put("constraints", "constraints"); } if (showDefaultValue) { propertyMetadata.put("defaultValue", "default"); } return propertyMetadata; }
public static boolean isNotNull(Element el) { return isNotNull(el, true); }
public String getConstraints() { return BeanValidationUtils.describeConstraints(this.accessor, this.accessor instanceof Element && ((Element) this.accessor).isRequired()); }
for (Element element : this.typeDefinition.getElements()) { for (Element choice : element.getChoices()) { if (BeanValidationUtils.hasConstraints(choice, choice.isRequired())) { showConstraints = true;
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = BeanValidationUtils.isNotNull(this); if (propertyInfo != null && !required) { required = propertyInfo.required(); } return required; }
public String getConstraints() { return BeanValidationUtils.describeConstraints(member, isRequired()); }
for (Element element : this.typeDefinition.getElements()) { for (Element choice : element.getChoices()) { if (BeanValidationUtils.hasConstraints(choice, choice.isRequired())) { showConstraints = true;
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = BeanValidationUtils.isNotNull(this); if (xmlElement != null && !required) { required = xmlElement.required(); } return required; }
public String getConstraints() { return BeanValidationUtils.describeConstraints(member, isRequired()); }
/** * Whether this element is required. * * @return Whether this element is required. */ public boolean isRequired() { boolean required = BeanValidationUtils.isNotNull(this); if (xmlElement != null && !required) { required = xmlElement.required(); } return required; }
@Override public String getConstraints() { String validationConstraints = BeanValidationUtils.describeConstraints(this.param, false); if (validationConstraints != null && !validationConstraints.isEmpty()) { return validationConstraints; } ResourceParameterConstraints constraints = this.param.getConstraints(); if (constraints != null && constraints.getType() != null) { switch (constraints.getType()) { case ENUMERATION: StringBuilder builder = new StringBuilder(); Iterator<String> it = ((ResourceParameterConstraints.Enumeration) constraints).getValues().iterator(); while (it.hasNext()) { String next = it.next(); builder.append('"').append(next).append('"'); if (it.hasNext()) { builder.append(" or "); } } return builder.toString(); case PRIMITIVE: return ((ResourceParameterConstraints.Primitive) constraints).getKind().name().toLowerCase(); case REGEX: return "regex: " + ((ResourceParameterConstraints.Regex) constraints).getRegex(); default: //fall through... } } return null; }