package step.core; import java.io.*; import java.util.*; public class StepGenericRepositoryResolver extends StepAbstractRepositoryVisitor { StepGenericRepositoryResolver(StepAbstractRepository repo) { super(repo); } public void accept(StepGenericRepository e) throws Exception { for (int i = 0; i <= e.getMaxId(); i++) { StepObject inst = e.instanceAt(i); if (inst != null) { ((StepGenericInstance)inst).accept(this); } } } public void accept(StepAggregationValue e) throws Exception { for (int i = 0; i < e.size(); i++) { e.get(i).accept(this); } } public void accept(StepStringValue e) throws Exception { } public void accept(StepBinaryValue e) throws Exception { } public void accept(StepEncodedStringValue e) throws Exception { } public void accept(StepEnumerationValue e) throws Exception { } public void accept(StepExternalRepresentation e) throws Exception { for (int i = 0; i < e.size(); i++) { e.get(i).accept(this); } } public void accept(StepHeaderInstance e) throws Exception { } public void accept(StepGenericInstanceReference e) throws Exception { StepObject refed = repo.instanceAt(e.getId()); if (refed == null) { // throw new StepExistingUnresolvedInstanceReferenceException(unres); System.out.println("Warning: unresolved reference: " + e.getId()); } e.setVal(refed); } public void accept(StepIntegerValue e) throws Exception { } public void accept(StepInternalRepresentation e) throws Exception { for (int i = 0; i < e.size(); i++) { e.get(i).accept(this); } } public void accept(StepLogicalValue e) throws Exception { } public void accept(StepNoValue e) throws Exception { } public void accept(StepRealValue e) throws Exception { } public void accept(StepRedefinedValue e) throws Exception { } public void accept(StepSimpleRecord e) throws Exception { accept((StepAggregationValue) e); } public void accept(StepTypedValue e) throws Exception { e.getVal().accept(this); } }