use of com.thinkbiganalytics.policy.rest.model.FieldValidationRuleBuilder in project kylo by Teradata.
the class AvailablePolicies method discoverValidationRules.
public static List<FieldValidationRule> discoverValidationRules() {
List<FieldValidationRule> rules = new ArrayList<>();
Set<Class<?>> validators = ReflectionPolicyAnnotationDiscoverer.getTypesAnnotatedWith(Validator.class);
for (Class c : validators) {
Validator validator = (Validator) c.getAnnotation(Validator.class);
List<FieldRuleProperty> properties = ValidatorAnnotationTransformer.instance().getUiProperties(c);
rules.add(new FieldValidationRuleBuilder(validator.name()).description(validator.description()).addProperties(properties).objectClassType(c).build());
}
return rules;
}
Aggregations