public static boolean containSameAnnotations(AnnotatedObject ao1, AnnotatedObject ao2) { return areCollectionEqual(IntactCore.ensureInitializedAnnotations(ao1), IntactCore.ensureInitializedAnnotations(ao2)); }
public static boolean containSameAnnotations(AnnotatedObject ao1, AnnotatedObject ao2) { return areCollectionEqual(IntactCore.ensureInitializedAnnotations(ao1), IntactCore.ensureInitializedAnnotations(ao2)); }
public static Collection<Annotation> getPublicAnnotations(final AnnotatedObject<?, ?> annotatedObject) { final Collection<Annotation> publicAnnotations = new ArrayList<Annotation>(annotatedObject.getAnnotations().size()); final Iterator<Annotation> i = IntactCore.ensureInitializedAnnotations(annotatedObject).iterator(); while (i.hasNext()) { Annotation annotation = i.next(); if (isCvTopicPublic(annotation.getCvTopic())) { publicAnnotations.add(annotation); } } return publicAnnotations; }
public static Collection<Annotation> getPublicAnnotations(final AnnotatedObject<?, ?> annotatedObject) { final Collection<Annotation> publicAnnotations = new ArrayList<Annotation>(annotatedObject.getAnnotations().size()); final Iterator<Annotation> i = IntactCore.ensureInitializedAnnotations(annotatedObject).iterator(); while (i.hasNext()) { Annotation annotation = i.next(); if (isCvTopicPublic(annotation.getCvTopic())) { publicAnnotations.add(annotation); } } return publicAnnotations; }
/** * Find all annotations having any of the provided CvTopics. * * @param annotatedObject the object to serch on. * @param topics the topics we are searching. * @return a non null collection of Annotation. */ public static Collection<Annotation> findAnnotationsByCvTopic(AnnotatedObject<?, ?> annotatedObject, Collection<CvTopic> topics) { if (annotatedObject == null) { throw new NullPointerException("You must give a non null annotatedObject"); } if (topics == null) { throw new NullPointerException("You must give a non null collection of CvTopic"); } Collection<Annotation> annotations = new ArrayList<Annotation>(); if (!topics.isEmpty()) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(annotatedObject)) { if (topics.contains(annotation.getCvTopic())) { annotations.add(annotation); } } } return annotations; }
/** * Find all annotations having any of the provided CvTopics. * * @param annotatedObject the object to serch on. * @param topics the topics we are searching. * @return a non null collection of Annotation. */ public static Collection<Annotation> findAnnotationsByCvTopic(AnnotatedObject<?, ?> annotatedObject, Collection<CvTopic> topics) { if (annotatedObject == null) { throw new NullPointerException("You must give a non null annotatedObject"); } if (topics == null) { throw new NullPointerException("You must give a non null collection of CvTopic"); } Collection<Annotation> annotations = new ArrayList<Annotation>(); if (!topics.isEmpty()) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(annotatedObject)) { if (topics.contains(annotation.getCvTopic())) { annotations.add(annotation); } } } return annotations; }
/** * Checks if a Cv object contains the "hidden" annotation * @param cvObject the object that may be hidden * @return true if hidden * * @since 2.5.0 */ public static boolean isHidden(CvObject cvObject) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvObject)) { if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; } }
/** * Checks if a Cv object contains the "hidden" annotation * @param cvObject the object that may be hidden * @return true if hidden * * @since 2.5.0 */ public static boolean isHidden(CvObject cvObject) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvObject)) { if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equals(annotation.getCvTopic().getShortLabel())) { return true; } } return false; } }
public static boolean isCvTopicPublic(CvTopic cvTopic) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvTopic)) { if(annotation.getCvTopic() != null){ if (annotation.getCvTopic().getShortLabel().equals(CvTopic.HIDDEN) || annotation.getCvTopic().getShortLabel().equals(CvTopic.NO_EXPORT)) { return false; } } else { return false; } } return true; }
public static boolean isCvTopicPublic(CvTopic cvTopic) { for (Annotation annotation : IntactCore.ensureInitializedAnnotations(cvTopic)) { if(annotation.getCvTopic() != null){ if (annotation.getCvTopic().getShortLabel().equals(CvTopic.HIDDEN) || annotation.getCvTopic().getShortLabel().equals(CvTopic.NO_EXPORT)) { return false; } } else { return false; } } return true; }
private static void populateAttributes( AnnotatedObject<?, ?> annotatedObject, AttributeContainer attributeContainer ) { AnnotationConverter annotationConverter = new AnnotationConverter( annotatedObject.getOwner() ); AnnotationConverterConfig configAnnotation = ConverterContext.getInstance().getAnnotationConfig(); for ( Annotation annotation : IntactCore.ensureInitializedAnnotations(annotatedObject) ) { if (!configAnnotation.isExcluded(annotation.getCvTopic())) { Attribute attribute = annotationConverter.intactToPsi( annotation ); if (!attributeContainer.getAttributes().contains( attribute )) { attributeContainer.getAttributes().add( attribute ); } } } }
public static void populateAttributes( AnnotatedObject<?, ?> annotatedObject, AttributeContainer attributeContainer, AnnotationConverter annotationConverter ) { AnnotationConverterConfig configAnnotation = ConverterContext.getInstance().getAnnotationConfig(); Collection<Annotation> annotations; if (annotationConverter.isCheckInitializedCollections()){ annotations = IntactCore.ensureInitializedAnnotations(annotatedObject); } else { annotations = annotatedObject.getAnnotations(); } for ( Annotation annotation : annotations ) { if (!configAnnotation.isExcluded(annotation.getCvTopic())) { Attribute attribute = annotationConverter.intactToPsi( annotation ); if (!attributeContainer.getAttributes().contains( attribute )) { attributeContainer.getAttributes().add( attribute ); } } } }
annotations.addAll(IntactCore.ensureInitializedAnnotations(experiment)); experiment.getAnnotations().clear(); experiment.getAnnotations().addAll(annotations);
annotations.addAll(IntactCore.ensureInitializedAnnotations(experiment)); experiment.getAnnotations().clear(); experiment.getAnnotations().addAll(annotations);
confidences = IntactCore.ensureInitializedConfidences(intactObject); parameters = IntactCore.ensureInitializedInteractionParameters(intactObject); annotations = IntactCore.ensureInitializedAnnotations(intactObject);
public T intactToPsi(C intactObject) { intactStartConversation(intactObject); T cvType = (T) ConversionCache.getElement(elementKey(intactObject)); if (cvType != null) { return cvType; } cvType = newCvInstance(psiCvClass); // Set id, annotations, xrefs and aliases PsiConverterUtils.populateNames(intactObject, cvType, aliasConverter); PsiConverterUtils.populateXref(intactObject, cvType, xrefConverter); AnnotationConverterConfig configAnnotation = ConverterContext.getInstance().getAnnotationConfig(); Collection<Annotation> annotations; if (annotationConverter.isCheckInitializedCollections()){ annotations = IntactCore.ensureInitializedAnnotations(intactObject); } else { annotations = intactObject.getAnnotations(); } for ( Annotation annotation : annotations ) { if (!configAnnotation.isExcluded(annotation.getCvTopic())) { Attribute attribute = annotationConverter.intactToPsi( annotation ); if (!cvType.getAttributes().contains( attribute )) { cvType.getAttributes().add( attribute ); } } } ConversionCache.putElement(elementKey(intactObject), cvType); intactEndConversion(intactObject); return cvType; }
Collection<Annotation> annotations = IntactCore.ensureInitializedAnnotations(ao);
Collection<Annotation> annotations = IntactCore.ensureInitializedAnnotations(ao);