Size a = (Size) helper.getAnnotation(element, Size.class);
final int min = a.min();
final int max = a.max();
if (min != 0 || max != Integer.MAX_VALUE) { // Fixes generation of an empty facet.
if ("java.lang.String".equals(property.getType().getName())) { // @Size serves for both length facet and occurs restriction.
SizeFacet facet = new SizeFacet(min, max); // For minLength, maxLength.
property.addFacet(facet);
} else { // For minOccurs, maxOccurs.
if (min > 0) property.setMinOccurs(min); // 0 is default minBoundary.
if (max < Integer.MAX_VALUE) property.setMaxOccurs(max); // 2^31 is default maxBoundary.
}