@Override public void visit(SequenceAnnotation annotation) { super.visit(annotation); add(annotation); if (duplicates.contains(annotation.getSubComponent())) { annotation.setSubComponent(map(annotation.getSubComponent())); } }
@Override public void visit(DnaComponent component) { super.visit(component); add(component); if (duplicates.contains(component)) { component.setDnaSequence(map(component.getDnaSequence())); } removeDuplicates(component.getAnnotations()); }
@Override public void visit(DnaComponent component) { Map<URI, SequenceAnnotation> previous = current; current = new HashMap<URI, SequenceAnnotation>(); for (SequenceAnnotation annotation : component.getAnnotations()) { current.put(annotation.getURI(), annotation); } super.visit(component); current = previous; }
@Override public void visit(SequenceAnnotation annotation) { for (PrecedeReference reference : ((SequenceAnnotationImpl) annotation).getPrecedeReferences()) { SequenceAnnotation sa = current.get(reference.resource); if (sa != null) { reference.setValue(sa); } else if (validate) { throw new SBOLValidationException( "Cannot resolve precede reference to sequence annotation: " + reference.resource); } } super.visit(annotation); }
@Override public void visit(DnaSequence sequence) { super.visit(sequence); add(sequence); }
@Override public void visit(Collection coll) { super.visit(coll); add(coll); removeDuplicates(coll.getComponents()); }
@Override public void visit(SBOLDocument doc) { super.visit(doc); removeDuplicates(doc.getContents()); }