/** * {@inheritDoc} */ public <T extends Annotation> void performAppend(ConstraintValidation<T> validation) { feature.addValidation(validation); } }
/** * Get the specified feature. * * @param <T> * @param key * @return T */ public <T> T getFeature(String key) { return getFeature(key, (T) null); }
/** * Create a deep copy (copy receiver and copy properties). * * @param <T> * @return new T instance */ public <T extends FeaturesCapable> T copy() { try { @SuppressWarnings("unchecked") final T self = (T) clone(); copyInto(self); return self; } catch (CloneNotSupportedException e) { throw new IllegalStateException("cannot clone() " + this, e); } }
if (xmlProp.getValidators() != null) { String[] func = prop.getFeature(JAVASCRIPT_VALIDATION_FUNCTIONS); List<String> jsValidators = new ArrayList<String>(xmlProp.getValidators().size() + (func == null ? 0 : func.length)); if (validator != null) { if (validator.getValidation() != null) { prop.addValidation(validator.getValidation()); prop.putFeature(JAVASCRIPT_VALIDATION_FUNCTIONS, jsValidators.toArray(new String[jsValidators.size()])); if (!prop.hasValidation(standardValidation)) prop.addValidation(standardValidation); } else if (addStandard && standardValidation != null && !prop.hasValidation(standardValidation)) { prop.addValidation(standardValidation);
/** * Copy this {@link FeaturesCapable} into another {@link FeaturesCapable} * instance. * * @param target */ protected void copyInto(FeaturesCapable target) { target.features = target.createFeaturesMap(); target.features.putAll(features); target.validations = validations != null ? validations.clone() : null; }
public void mergeFeaturesInto(FeaturesCapable fc) { if (getFeatures() != null) { for (XMLMetaFeature each : getFeatures()) { fc.putFeature(each.getKey(), each.getValue()); } } } }
if (ArrayUtils.isEmpty(meta.getValidations())) { return Collections.<ConstraintViolation<T>> emptySet();
/** * {@inheritDoc} */ @Override protected void copyInto(FeaturesCapable target) { super.copyInto(target); final MetaBean copy = (MetaBean) target; if (properties != null) { copy.properties = new TreeMap<String, MetaProperty>(); for (Map.Entry<String, MetaProperty> entry : properties.entrySet()) { copy.properties.put(entry.getKey(), (MetaProperty) entry.getValue().copy()); } } }