Search in sources :

Example 1 with FieldStandardizationRuleBuilder

use of com.thinkbiganalytics.policy.rest.model.FieldStandardizationRuleBuilder in project kylo by Teradata.

the class AvailablePolicies method discoverStandardizationRules.

public static List<FieldStandardizationRule> discoverStandardizationRules() {
    List<FieldStandardizationRule> rules = new ArrayList<>();
    Set<Class<?>> standardizers = ReflectionPolicyAnnotationDiscoverer.getTypesAnnotatedWith(Standardizer.class);
    for (Class c : standardizers) {
        Standardizer standardizer = (Standardizer) c.getAnnotation(Standardizer.class);
        List<FieldRuleProperty> properties = StandardizationAnnotationTransformer.instance().getUiProperties(c);
        rules.add(new FieldStandardizationRuleBuilder(standardizer.name()).description(standardizer.description()).addProperties(properties).objectClassType(c).build());
    }
    return rules;
}
Also used : FieldStandardizationRuleBuilder(com.thinkbiganalytics.policy.rest.model.FieldStandardizationRuleBuilder) ArrayList(java.util.ArrayList) Standardizer(com.thinkbiganalytics.policy.standardization.Standardizer) FieldRuleProperty(com.thinkbiganalytics.policy.rest.model.FieldRuleProperty) FieldStandardizationRule(com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule)

Aggregations

FieldRuleProperty (com.thinkbiganalytics.policy.rest.model.FieldRuleProperty)1 FieldStandardizationRule (com.thinkbiganalytics.policy.rest.model.FieldStandardizationRule)1 FieldStandardizationRuleBuilder (com.thinkbiganalytics.policy.rest.model.FieldStandardizationRuleBuilder)1 Standardizer (com.thinkbiganalytics.policy.standardization.Standardizer)1 ArrayList (java.util.ArrayList)1