use of org.talend.core.model.metadata.builder.connection.ValidationRulesConnection in project tdi-studio-se by Talend.
the class ValidationRulesUtil method getRelatedValidationRuleObjs.
public static List<IRepositoryViewObject> getRelatedValidationRuleObjs(String schemaId) {
List<IRepositoryViewObject> rulesObjs = new ArrayList<IRepositoryViewObject>();
if (schemaId != null) {
try {
IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
List<IRepositoryViewObject> members = factory.getAll(ERepositoryObjectType.METADATA_VALIDATION_RULES);
if (members != null && members.size() > 0) {
for (IRepositoryViewObject member : members) {
if (member != null && member.getProperty() != null) {
Item item = member.getProperty().getItem();
if (item != null && item instanceof ValidationRulesConnectionItem) {
ValidationRulesConnectionItem validItem = (ValidationRulesConnectionItem) item;
ValidationRulesConnection connection = (ValidationRulesConnection) validItem.getConnection();
if (connection != null && !rulesObjs.contains(member)) {
rulesObjs.add(member);
}
}
}
}
}
} catch (PersistenceException e) {
ExceptionHandler.process(e);
}
}
return rulesObjs;
}
Aggregations