protected void traverseAnnotation(Annotation annotation, IntactVisitor... visitors) { if (annotation == null) return; for (IntactVisitor visitor : visitors) { visitor.visitAnnotation(annotation); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(annotation)) { return; } traverse(annotation.getCvTopic(), visitors); traverse(annotation.getOwner(), visitors); }
protected void traverseAnnotation(Annotation annotation, IntactVisitor... visitors) { if (annotation == null) return; for (IntactVisitor visitor : visitors) { visitor.visitAnnotation(annotation); } // check if this element has been traversed already, to avoid cyclic recursion if (recursionChecker.isAlreadyTraversed(annotation)) { return; } traverse(annotation.getCvTopic(), visitors); traverse(annotation.getOwner(), visitors); }
@Override protected void saveOrUpdateAttributes( T intactObject ) throws PersisterException { if ( intactObject == null ) { throw new NullPointerException( "intactObject" ); } InstitutionPersister institutionPersister = InstitutionPersister.getInstance(); institutionPersister.saveOrUpdate( intactObject.getOwner() ); CvObjectPersister cvPersister = CvObjectPersister.getInstance(); for ( Xref xref : intactObject.getXrefs() ) { cvPersister.saveOrUpdate( xref.getCvDatabase() ); if ( xref.getCvXrefQualifier() != null ) { cvPersister.saveOrUpdate( xref.getCvXrefQualifier() ); } institutionPersister.saveOrUpdate( xref.getOwner() ); } for ( Alias alias : intactObject.getAliases() ) { if ( alias.getCvAliasType() != null ) { cvPersister.saveOrUpdate( alias.getCvAliasType() ); } institutionPersister.saveOrUpdate( alias.getOwner() ); } for ( Annotation annotation : intactObject.getAnnotations() ) { if ( annotation.getCvTopic() != null ) { cvPersister.saveOrUpdate( annotation.getCvTopic() ); } institutionPersister.saveOrUpdate( annotation.getOwner() ); } }
annotation.setCvTopic(cvTopic); annotation.setOwner(institutionPersister.syncIfTransient(annotation.getOwner()));