use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.
the class SchemaDiscoveryRestControllerTest method createMockParserDescriptor.
private SchemaParserDescriptor createMockParserDescriptor() {
SchemaParserDescriptor descriptor = new SchemaParserDescriptor();
descriptor.setObjectClassType("com.thinkbiganalytics.discovery.rest.controller.MockSchemaParser2");
FieldRuleProperty propDetect = new FieldRuleProperty();
propDetect.setName("Auto Detect?");
propDetect.setObjectProperty("autoDetect");
propDetect.setValue("true");
FieldRuleProperty propHeader = new FieldRuleProperty();
propHeader.setName("Header?");
propHeader.setObjectProperty("headerRow");
propHeader.setValue("false");
descriptor.setProperties(Arrays.asList(propDetect, propHeader));
return descriptor;
}
use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.
the class ServiceLevelAgreementActionConfigTransformer method buildActionConfigurationRegistry.
private synchronized void buildActionConfigurationRegistry() {
actionConfigurationRegistry = new ArrayList<>();
List<ServiceLevelAgreementActionUiConfigurationItem> rules = new ArrayList<>();
Set<Class<?>> items = ReflectionPolicyAnnotationDiscoverer.getTypesAnnotatedWith(ServiceLevelAgreementActionConfig.class);
for (Class c : items) {
List<FieldRuleProperty> properties = getUiProperties(c);
ServiceLevelAgreementActionConfig policy = (ServiceLevelAgreementActionConfig) c.getAnnotation(ServiceLevelAgreementActionConfig.class);
ServiceLevelAgreementActionUiConfigurationItem configItem = buildUiModel(policy, c, properties);
rules.add(configItem);
actionConfigurationRegistry.add(configItem);
}
}
use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.
the class IntegrationTestBase method newFieldRuleProperty.
protected FieldRuleProperty newFieldRuleProperty(String name, String objectProperty, String value) {
FieldRuleProperty list = new FieldRuleProperty();
list.setName(name);
list.setObjectProperty(objectProperty);
list.setValue(value);
return list;
}
use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty in project kylo by Teradata.
the class BasePolicyAnnotationTransformer method toUIModel.
/**
* Transform a domain policy rule to a user interface object
*
* @param policyRule the domain object
* @return the user interface object
*/
@Override
public U toUIModel(P policyRule) {
Annotation annotation = policyRule.getClass().getAnnotation(getAnnotationClass());
List<FieldRuleProperty> properties = getUiProperties(policyRule);
U rule = buildUiModel((A) annotation, policyRule, properties);
return rule;
}
use of com.thinkbiganalytics.policy.rest.model.FieldRuleProperty 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;
}
Aggregations