Tabnine Logo
AnnotatedObject.getAnnotations
Code IndexAdd Tabnine to your IDE (free)

How to use
getAnnotations
method
in
uk.ac.ebi.intact.model.AnnotatedObject

Best Java code snippets using uk.ac.ebi.intact.model.AnnotatedObject.getAnnotations (Showing top 20 results out of 315)

origin: uk.ac.ebi.intact.core/intact-core

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;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

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;
}
origin: uk.ac.ebi.intact.core/intact-core

private boolean hasNoUniprotUpdateAnnotation( AnnotatedObject ao ) {
  for ( Annotation annot : ao.getAnnotations() ) {
    if( annot.getCvTopic().getShortLabel().equals( CvTopic.NON_UNIPROT ) ) {
      return true;
    }
  }
  return false;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private boolean hasNoUniprotUpdateAnnotation( AnnotatedObject ao ) {
  for ( Annotation annot : ao.getAnnotations() ) {
    if( annot.getCvTopic().getShortLabel().equals( CvTopic.NON_UNIPROT ) ) {
      return true;
    }
  }
  return false;
}
origin: uk.ac.ebi.intact.core/intact-persister

  protected boolean updateCommonAttributes(T candidateObject, T objectToBeUpdated) throws PersisterException {

    for (Annotation annotation : candidateObject.getAnnotations()) {
      objectToBeUpdated.addAnnotation(annotation);
    }

    saveOrUpdateAttributes(objectToBeUpdated);

    return true;
  }
}
origin: uk.ac.ebi.intact.dataexchange.uniprotexport/intact-uniprot-export

/**
 * Answers the question: is that AnnotatedObject (Interaction, Experiment) annotated as negative ?
 *
 * @param annotatedObject the object we want to introspect
 *
 * @return true if the object is annotated with the 'negative' CvTopic, otherwise false.
 */
public boolean isNegative(AnnotatedObject annotatedObject) {
  boolean isNegative = false;
  Collection<Annotation> annotations = annotatedObject.getAnnotations();
  for (Iterator<Annotation> iterator = annotations.iterator(); iterator.hasNext() && false == isNegative;) {
    Annotation annotation = iterator.next();
    if (getNegative().equals(annotation.getCvTopic())) {
      isNegative = true;
    }
  }
  return isNegative;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Finds an Annotations with a topic that has an MI or label equal to the value provided
 *
 * @param annotatedObject The annotatedObject to find the annotation
 * @param miOrLabel       The MI (use it when possible) or the shortLabel
 * @return The annotation with that CvTopic. Null if no annotation for that CV is found
 * @since 1.8.0
 */
public static Annotation findAnnotationByTopicMiOrLabel(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  for (Annotation annotation : annotatedObject.getAnnotations()) {
    final CvTopic topic = annotation.getCvTopic();
    if (topic != null && (miOrLabel.equals(topic.getIdentifier()) || miOrLabel.equals(topic.getShortLabel()))) {
      return annotation;
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Finds an Annotations with a topic that has an MI or label equal to the value provided
 *
 * @param annotatedObject The annotatedObject to find the annotation
 * @param miOrLabel       The MI (use it when possible) or the shortLabel
 * @return The annotation with that CvTopic. Null if no annotation for that CV is found
 * @since 1.8.0
 */
public static Annotation findAnnotationByTopicMiOrLabel(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  for (Annotation annotation : annotatedObject.getAnnotations()) {
    final CvTopic topic = annotation.getCvTopic();
    if (topic != null && (miOrLabel.equals(topic.getIdentifier()) || miOrLabel.equals(topic.getShortLabel()))) {
      return annotation;
    }
  }
  return null;
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Retrieves the annotations from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized annotations
 * @return The returned annotations are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(ao.getAnnotations())) {
    annotations = ao.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Retrieves the annotations from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized annotations
 * @return The returned annotations are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<Annotation> ensureInitializedAnnotations(AnnotatedObject ao) {
  Collection<Annotation> annotations;
  if (IntactCore.isInitialized(ao.getAnnotations())) {
    annotations = ao.getAnnotations();
  } else {
    annotations = IntactContext.getCurrentInstance().getDaoFactory().getAnnotationDao().getByParentAc(ao.getClass(), ao.getAc());
  }
  return annotations;
}
origin: uk.ac.ebi.intact.sanity/intact-sanity-rules

  protected String getIdValidationRegexp(AnnotatedObject<?,?> annotatedObject) {
    String regexp = null;

    for (Annotation annotation : annotatedObject.getAnnotations()) {
      if (annotation.getCvTopic() != null) {
        CvObjectXref idXref = CvObjectUtils.getPsiMiIdentityXref(annotation.getCvTopic());
        if (idXref != null &&
          idXref.getPrimaryId().equals(CvTopic.XREF_VALIDATION_REGEXP_MI_REF)) {
           regexp = annotation.getAnnotationText();
        }
      }
    }

    return regexp;
  }
}
origin: uk.ac.ebi.intact.core/intact-core

protected <X extends Xref, A extends Alias> void copyAnotatedObjectCommons( AnnotatedObject<X, A> source,
                                      AnnotatedObject<X, A> target ) {
  // if the source does not have an AC, we should not update the target shortLabel, fullName and owner
  // as it does not make much sense
  //if (source.getAc() != null) {
    copyProperty(source, "shortLabel", target);
    copyProperty(source, "fullName", target);
    copyProperty(source, "owner", target);
  //}
  copyXrefCollection( source.getXrefs(), target.getXrefs() );
  copyAliasCollection( source.getAliases(), target.getAliases(), source, target );
  copyAnnotationCollection( source.getAnnotations(), target.getAnnotations() );
}
origin: uk.ac.ebi.intact.core/intact-core

private <T extends AnnotatedObject> void initializeCommonsIfNecessary(T ao, T managedObject) {
  if (IntactCore.isInitialized(ao.getXrefs()))
    IntactCore.initialize(managedObject.getXrefs());
  if (IntactCore.isInitialized(ao.getAnnotations()))
    IntactCore.initialize(managedObject.getAnnotations());
  if (IntactCore.isInitialized(ao.getAliases())) {
    IntactCore.initialize(managedObject.getAliases());
  }
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Initializes the AnnotatedObject collections (xrefs, aliases, annotations).
 *
 * @param ao The annotatedObject
 */
public static void initializeAnnotatedObject(AnnotatedObject ao) {
  initialize(ao.getXrefs());
  initialize(ao.getAliases());
  initialize(ao.getAnnotations());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Initializes the AnnotatedObject collections (xrefs, aliases, annotations).
 *
 * @param ao The annotatedObject
 */
public static void initializeAnnotatedObject(AnnotatedObject ao) {
  initialize(ao.getXrefs());
  initialize(ao.getAliases());
  initialize(ao.getAnnotations());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

private <T extends AnnotatedObject> void initializeCommonsIfNecessary(T ao, T managedObject) {
  if (IntactCore.isInitialized(ao.getXrefs()))
    IntactCore.initialize(managedObject.getXrefs());
  if (IntactCore.isInitialized(ao.getAnnotations()))
    IntactCore.initialize(managedObject.getAnnotations());
  if (IntactCore.isInitialized(ao.getAliases())) {
    IntactCore.initialize(managedObject.getAliases());
  }
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected <X extends Xref, A extends Alias> void copyAnotatedObjectCommons( AnnotatedObject<X, A> source,
                                      AnnotatedObject<X, A> target ) {
  // if the source does not have an AC, we should not update the target shortLabel, fullName and owner
  // as it does not make much sense
  //if (source.getAc() != null) {
    copyProperty(source, "shortLabel", target);
    copyProperty(source, "fullName", target);
    copyProperty(source, "owner", target);
  //}
  copyXrefCollection( source.getXrefs(), target.getXrefs() );
  copyAliasCollection( source.getAliases(), target.getAliases(), source, target );
  copyAnnotationCollection( source.getAnnotations(), target.getAnnotations() );
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

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 );
      }
    }
  }
}
origin: uk.ac.ebi.intact.core/intact-core

protected void traverseAnnotatedObjectCommon(AnnotatedObject ao, IntactVisitor ... visitors) {
  traverse(ao.getAnnotations(), visitors);
  traverse(ao.getAliases(), visitors);
  traverse(ao.getXrefs(), visitors);
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(ao)) {
    return;
  }
  traverse(ao.getOwner(), visitors);
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

protected void traverseAnnotatedObjectCommon(AnnotatedObject ao, IntactVisitor ... visitors) {
  traverse(ao.getAnnotations(), visitors);
  traverse(ao.getAliases(), visitors);
  traverse(ao.getXrefs(), visitors);
  // check if this element has been traversed already, to avoid cyclic recursion
  if (recursionChecker.isAlreadyTraversed(ao)) {
    return;
  }
  traverse(ao.getOwner(), visitors);
}
uk.ac.ebi.intact.modelAnnotatedObjectgetAnnotations

Popular methods of AnnotatedObject

  • getAc
  • getShortLabel
  • getXrefs
  • getAliases
  • getOwner
  • getFullName
  • getCreated
  • addAnnotation
  • setOwner
  • addAlias
  • addXref
  • setAc
  • addXref,
  • setAc,
  • setFullName,
  • setShortLabel,
  • getCreator,
  • removeAlias,
  • removeAnnotation,
  • removeXref,
  • setCreated

Popular in Java

  • Parsing JSON documents to java classes using gson
  • addToBackStack (FragmentTransaction)
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • Menu (java.awt)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • String (java.lang)
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now