@Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); String tagName = tag.getName().toLowerCase(Locale.ROOT); boolean hasLengthAttribute = hasLengthAttribute(tagName); Integer maximum = getMaximum(); if (maximum != null && hasLengthAttribute) { tag.put("maxlength", maximum); } Integer minimum = getMinimum(); if (minimum != null && hasLengthAttribute) { tag.put("minlength", minimum); } }
@Override public void onComponentTag(Component component, ComponentTag tag) { super.onComponentTag(component, tag); String tagName = tag.getName().toLowerCase(Locale.ROOT); boolean hasLengthAttribute = hasLengthAttribute(tagName); Integer maximum = getMaximum(); if (maximum != null && hasLengthAttribute) { tag.put("maxlength", maximum); } Integer minimum = getMinimum(); if (minimum != null && hasLengthAttribute) { tag.put("minlength", minimum); } }