com.nedap.archie.rules.evaluation.AssertionsFixer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tools Show documentation
Show all versions of tools Show documentation
tools that operate on the archie reference models and archetype object model
package com.nedap.archie.rules.evaluation;
import com.google.common.collect.Lists;
import com.nedap.archie.aom.*;
import com.nedap.archie.creation.RMObjectCreator;
import com.nedap.archie.rminfo.ModelInfoLookup;
import com.nedap.archie.rminfo.RMAttributeInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by pieter.bos on 05/04/2017.
*/
public class AssertionsFixer {
private static final Logger logger = LoggerFactory.getLogger(AssertionsFixer.class);
private final RMObjectCreator creator;
private final RuleEvaluation> ruleEvaluation;
private final RMObjectCreator rmObjectCreator;
private ModelInfoLookup modelInfoLookup;
public AssertionsFixer(RuleEvaluation> evaluation, RMObjectCreator creator) {
this.creator = creator;
this.ruleEvaluation = evaluation;
this.modelInfoLookup = ruleEvaluation.getModelInfoLookup();
rmObjectCreator = new RMObjectCreator(evaluation.getModelInfoLookup());
}
public Map fixAssertions(Archetype archetype, AssertionResult assertionResult) {
Map result = new HashMap<>();
Map> setPathValues = assertionResult.getSetPathValues();
for(String path:setPathValues.keySet()) {
Value> value = setPathValues.get(path);
String pathOfParent = stripLastPathSegment(path);
String lastPathSegment = getLastPathSegment(path);
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy