public boolean isExcluded( CvTopic topic ) { if (topic != null && !topic.getAnnotations().isEmpty() && excludeHiddenTopics){ for (uk.ac.ebi.intact.model.Annotation ann : topic.getAnnotations()){ if (ann.getCvTopic() != null && (ann.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.HIDDEN) || ann.getCvTopic().getShortLabel().equalsIgnoreCase(CvTopic.NO_EXPORT))){ return true; } } } return excludeAnnotationTopic.contains( topic ); }
private Annotation getUsedInClassAnnotation(CvTopic cvTopic){ Collection<Annotation> annotations = cvTopic.getAnnotations(); for(Annotation annotation : annotations){ if(CvTopic.USED_IN_CLASS.equals(annotation.getCvTopic().getShortLabel())){ if(annotation.getAnnotationText() == null){ return null; } CACHE.put(cvTopic.getShortLabel(),annotation); return annotation; } } return null; } }
Collection<Annotation> cvTopicAnnotations = cvTopic.getAnnotations();
CvTopic cvTopic = (CvTopic) iterator.next(); for ( Iterator iterator1 = cvTopic.getAnnotations().iterator(); iterator1.hasNext(); ) { Annotation annotation = (Annotation) iterator1.next();
CvTopic cvTopic = (CvTopic) iterator.next(); for ( Iterator iterator1 = cvTopic.getAnnotations().iterator(); iterator1.hasNext(); ) { Annotation annotation = (Annotation) iterator1.next();
CvTopic cvTopic = (CvTopic) iterator.next(); for ( Iterator iterator1 = cvTopic.getAnnotations().iterator(); iterator1.hasNext(); ) { Annotation annotation = (Annotation) iterator1.next();
/** * Loads all CvTopics that should not be shown on the public interface. */ private AnnotationFilter() { logger.debug( "Initializing which CvTopic should be filtered out." ); // search for the CvTopic no-export CvTopic noExport = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotatedObjectDao( CvTopic.class ).getByShortLabel( CvTopic.NO_EXPORT ); if ( noExport != null ) { // load all CvTopics Collection<CvTopic> cvTopics = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao( CvTopic.class ).getAll(); // select those that have an Annotation( no-export ) for ( CvTopic cvTopic : cvTopics ) { for ( Annotation annotation : cvTopic.getAnnotations() ) { if ( noExport.equals( annotation.getCvTopic() ) ) { if ( filteredTopics == null ) { filteredTopics = new HashSet<CvTopic>( 8 ); } logger.debug( "CvTopic( " + cvTopic.getShortLabel() + " )" ); filteredTopics.add( cvTopic ); } } } } if ( filteredTopics == null ) { filteredTopics = Collections.EMPTY_SET; } logger.debug( filteredTopics.size() + " CvTopic" + ( filteredTopics.size() > 1 ? "s" : "" ) + " filtered." ); }