@Test public void testOntologyWalkOrder() { Archetype archetype = parseArchetype("adl15/walker/adl-test-entry.walk_order.v1.adls"); final OntologyListVisitor listVisitor = new OntologyListVisitor(); ArchetypeWalker.walkTerminology(listVisitor, archetype.getTerminology(), new AmVisitContext()); assertThat(listVisitor.visits).containsExactly( "ArchetypeTerminology", "TermBindingSet[SNOMED_CT]", "TermBindingItem[at0000/snomed_ct::1000339]", "TermBindingSet[ICD10]", "TermBindingItem[at0000/icd10::1000, icd10::1001]", "CodeDefinitionSet[en]", "ArchetypeTerm[at0000]", "ArchetypeTerm[at0001]", "ArchetypeTerm[at10002]"); }
public static <C extends AmVisitContext> void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context) { ArchetypeWalker<C> walker = new ArchetypeWalker<>(visitor, context); Action<?> action = walker.walk(terminology); if (action.act != Action.Act.next) { throw new AssertionError("Cannot remove or replace root ontology object"); } }
ArchetypeWalker { public static <C extends AmVisitContext> void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context) { ArchetypeWalker<C> walker = new ArchetypeWalker<>(visitor, context); Action<?> action = walker.walk(terminology); if (action.act != Action.Act.next) { throw new AssertionError("Cannot remove or replace root ontology object"); } } }
ArchetypeWalker { public static <C extends AmVisitContext> void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context) { ArchetypeWalker<C> walker = new ArchetypeWalker<>(visitor, context); Action<?> action = walker.walk(terminology); if (action.act != Action.Act.next) { throw new AssertionError("Cannot remove or replace root ontology object"); } } private  ArchetypeWalker(AmVisitor<AmObject, C> visitor, C context); }
ArchetypeWalker { public static <C extends AmVisitContext> void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context) { ArchetypeWalker<C> walker = new ArchetypeWalker<>(visitor, context); Action<?> action = walker.walk(terminology); if (action.act != Action.Act.next) { throw new AssertionError("Cannot remove or replace root ontology object"); } } private  ArchetypeWalker(AmVisitor<AmObject, C> visitor, C context); @SuppressWarnings("unchecked") static void walkConstraints(AmVisitor<T, C> visitor, Archetype archetype,
            C context); static void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context); }
ArchetypeWalker { public static <C extends AmVisitContext> void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context) { ArchetypeWalker<C> walker = new ArchetypeWalker<>(visitor, context); Action<?> action = walker.walk(terminology); if (action.act != Action.Act.next) { throw new AssertionError("Cannot remove or replace root ontology object"); } } private  ArchetypeWalker(AmVisitor<AmObject, C> visitor, C context); @SuppressWarnings("unchecked") static void walkConstraints(AmVisitor<T, C> visitor, Archetype archetype,
            C context); static void walkTerminology(AmVisitor<AmObject, C> visitor, ArchetypeTerminology terminology, C context);  }