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

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

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

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

private static void logPersistence(AnnotatedObject<?,?> ao) {
  if (log.isDebugEnabled()) {
    log.debug("\t\t\tPersisted with AC: " + ao.getAc());
    if (!ao.getXrefs().isEmpty()) {
      log.debug("\t\t\tXrefs: " + ao.getXrefs().size());
      for (Xref xref : ao.getXrefs()) {
        log.debug("\t\t\t\t"+xref);
      }
    }
    if (!ao.getAliases().isEmpty()) {
      log.debug("\t\t\tAliases: " + ao.getAliases().size());
      for (Alias alias: ao.getAliases()) {
        log.debug("\t\t\t\t"+alias);
      }
    }
    if (!ao.getAnnotations().isEmpty()) {
      log.debug("\t\t\tAnnotations: " + ao.getAnnotations().size());
      for (Annotation annot: ao.getAnnotations()) {
        log.debug("\t\t\t\t"+annot);
      }
    }
  }
}
origin: uk.ac.ebi.intact/intact-core

if ( annotatedObject.getAc() != null & ac != null ) {
  return ac.equals( annotatedObject.getAc() );
  if ( !shortLabel.equals( annotatedObject.getShortLabel() ) ) {
    return false;
  if ( annotatedObject.getShortLabel() != null ) {
    return false;
  if ( !fullName.equals( annotatedObject.getFullName() ) ) {
    return false;
  if ( annotatedObject.getFullName() != null ) {
    return false;
return CollectionUtils.isEqualCollection( getXrefs(), annotatedObject.getXrefs() );
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.util/data-conversion

public SimplifiedAnnotatedObject( AnnotatedObject annotatedObject ) {
  this.ac = annotatedObject.getAc();
  this.shortLabel = annotatedObject.getShortLabel();
  this.created = annotatedObject.getCreated();
}
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.core/intact-core-readonly

public AnnotatedObjectStatsUnit(AnnotatedObject ao) {
  this.shortLabel = ao.getShortLabel();
  this.ac = ao.getAc();
  this.type = CgLibUtil.removeCglibEnhanced(ao.getClass());
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

  clone.setOwner(clone(ao.getOwner()));
clone.setShortLabel(ao.getShortLabel());
clone.setFullName(ao.getFullName());
  String ac = ao.getAc();
if (isCollectionClonable(ao.getAnnotations())) {
  Collection<Annotation> annotations = IntactCore.ensureInitializedAnnotations(ao);
    clone.addAnnotation(clone(annotation));
if (isCollectionClonable(ao.getAliases())) {
  Collection<? extends Alias> aliases = IntactCore.ensureInitializedAliases(ao);
    clone.addAlias(clone(alias));
if (isCollectionClonable(ao.getXrefs())) {
  Collection<? extends Xref> refs = IntactCore.ensureInitializedXrefs(ao);
    clone.addXref(clone(xref));
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-persister

Institution owner = intactObject.getOwner();
intactObject.setOwner(institutionPersister.syncIfTransient(owner));
for (Xref xref : intactObject.getXrefs()) {
  CvDatabase cvDb = (CvDatabase) cvPersister.syncIfTransient(xref.getCvDatabase());
  xref.setCvDatabase(cvDb);
  xref.setOwner(institutionPersister.syncIfTransient(xref.getOwner()));
for (Alias alias :  intactObject.getAliases()) {
  CvAliasType cvAliasType = alias.getCvAliasType();
  alias.setOwner(institutionPersister.syncIfTransient(alias.getOwner()));
for (Annotation annotation : intactObject.getAnnotations()) {
  CvTopic cvTopic = annotation.getCvTopic();
throw new IntactException("Exception syncing attributes of: "+intactObject.getShortLabel()+" ("+intactObject.getAc()+")", t);
origin: uk.ac.ebi.intact.core/intact-core-readonly

private <T extends AnnotatedObject> void copyAnnotatedObjectAttributeAcs( T source, T target ) {
  if (IntactCore.isInitialized(target.getXrefs())) {
    for ( Iterator itXrefTarget = target.getXrefs().iterator(); itXrefTarget.hasNext(); ) {
      Xref targetXref = (Xref) itXrefTarget.next();
      for ( Iterator itXrefSrc = source.getXrefs().iterator(); itXrefSrc.hasNext(); ) {
        Xref sourceXref = ( Xref ) itXrefSrc.next();
      target.addXref( xref );
  if (IntactCore.isInitialized(target.getAliases())) {
    for ( Iterator itAliasTarget = target.getAliases().iterator(); itAliasTarget.hasNext(); ) {
      Alias targetAlias = (Alias) itAliasTarget.next();
      for ( Iterator itAliasSrc = source.getAliases().iterator(); itAliasSrc.hasNext(); ) {
        Alias sourceAlias = ( Alias ) itAliasSrc.next();
      target.addAlias( alias );
  if (IntactCore.isInitialized(target.getAnnotations())) {
    for ( Iterator itAnnotTarget = target.getAnnotations().iterator(); itAnnotTarget.hasNext(); ) {
      Annotation targetAnnot = (Annotation) itAnnotTarget.next();
      for ( Iterator itAnnotSrc = source.getAnnotations().iterator(); itAnnotSrc.hasNext(); ) {
        Annotation sourceAnnot = ( Annotation ) itAnnotSrc.next();
      target.addAnnotation( annotation );
origin: uk.ac.ebi.intact/intact-core

private static List<SearchItem> searchItemsForAnnotatedObject( AnnotatedObject<? extends Xref, ? extends Alias> ao, boolean includeAliases ) {
  List<SearchItem> searchItems = new ArrayList<SearchItem>();
  searchItems.add( new SearchItem( ao.getAc(), ao.getAc(), ao.getClass().getName(), "ac" ) );
  searchItems.add( new SearchItem( ao.getAc(), ao.getShortLabel(), ao.getClass().getName(), "shortlabel" ) );
  if ( ao.getFullName() != null ) {
    searchItems.add( new SearchItem( ao.getAc(), ao.getFullName(), ao.getClass().getName(), "fullname" ) );
  }
  if ( includeAliases ) {
    for ( Alias alias : ao.getAliases() ) {
      if ( alias.getCvAliasType() != null ) {
        searchItems.add( new SearchItem( ao.getAc(), alias.getName(), ao.getClass().getName(), alias.getCvAliasType().getShortLabel() ) );
      } else {
        log.warn( "Couldn't insert SearchItem for Alias, as it cvAliasType is null: " + alias.getName() );
      }
    }
  }
  return searchItems;
}
origin: uk.ac.ebi.intact.core/intact-core

if ( ao.getAc() == null || ao.getAc().length() == 0) {
    if (log.isTraceEnabled()) log.trace("New "+ao.getClass().getSimpleName()+": "+ao.getShortLabel()+" - Decision: PERSIST");
      if (log.isTraceEnabled()) log.trace("New (but found in database: "+ ac +") "+ao.getClass().getSimpleName()+": "+ao.getShortLabel()+" - Decision: UPDATE");
      ao.setAc(managedObject.getAc());
      if (log.isTraceEnabled()) log.trace("New (but found in database: "+ ac +") "+ao.getClass().getSimpleName()+": "+ao.getShortLabel()+" - Decision: IGNORE");
      if (statisticsEnabled) statistics.addDuplicate(ao);
      ao.setAc(ac);
      if (log.isTraceEnabled()) log.trace("Transient "+ao.getClass().getSimpleName()+": "+ao.getAc()+" "+ao.getShortLabel()+" - Decision: SYNCHRONIZE-REFRESH");
      String ac = ao.getAc();
        throw new IllegalStateException(ao.getClass().getSimpleName()+" is transient, but no object with the same AC could be found in database: "+ao.getAc()+" ("+ao.getShortLabel()+")");
          copied = entityStateCopier.copy( ao, managedObject);
        } catch (Exception e) {
          throw new PersisterException("Problem copying state to managed object of type "+ao.getClass().getSimpleName()+" and AC "+ao.getAc()+", from object: "+ao, e);
        ao.setAc(ac);
          copyAnnotatedObjectAttributeAcs(managedObject, ao);
        } catch (Exception e) {
          throw new PersisterException("Problem copying ACs from managed object of type "+ao.getClass().getSimpleName()+" and AC "+ao.getAc()+", to object: "+ao, e);
origin: uk.ac.ebi.intact/intact-core

@Transient
public String getParentAc() {
  if ( parent != null ) {
    parentAc = parent.getAc();
  }
  return parentAc;
}
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.dataexchange.psimi/intact-psixml-converters

protected static Institution getInstitution(AnnotatedObject ao) {
  if (ao instanceof Institution) {
    return (Institution)ao;
  } else {
    return ao.getOwner();
  }
}
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.dataexchange.psimi/intact-psixml-converters

protected static void populateNames( AnnotatedObject<?, ?> annotatedObject, NamesContainer namesContainer ) {
  Names names = namesContainer.getNames();
  if ( names == null ) {
    names = new Names();
  }
  String shortLabel = annotatedObject.getShortLabel();
  String fullName = annotatedObject.getFullName();
  names.setShortLabel( shortLabel );
  names.setFullName( fullName );
  if ( !ConverterContext.getInstance().getInteractorConfig().isExcludeInteractorAliases() ) {
    AliasConverter aliasConverter = new AliasConverter( annotatedObject.getOwner(),
        AnnotatedObjectUtils.getAliasClassType( annotatedObject.getClass() ) );
    for ( Alias alias : IntactCore.ensureInitializedAliases(annotatedObject)) {
      names.getAliases().add( aliasConverter.intactToPsi( alias ) );
    }
  }
  namesContainer.setNames( names );
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Returns the list of labels for the annotated objects provided
 *
 * @param intactObjects list of annotated objects
 *
 * @return a list of labels
 */
public static List<String> labelList( Collection<? extends AnnotatedObject> intactObjects ) {
  List<String> labels = new ArrayList<String>( intactObjects.size() );
  for ( AnnotatedObject io : intactObjects ) {
    labels.add( io.getShortLabel() );
  }
  return labels;
}
origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

public static void populateNames( AnnotatedObject<?, ?> annotatedObject, NamesContainer namesContainer, AliasConverter aliasConverter ) {
  Names names = namesContainer.getNames();
  if ( names == null ) {
    names = new Names();
  }
  String shortLabel = annotatedObject.getShortLabel();
  String fullName = annotatedObject.getFullName();
  names.setShortLabel( shortLabel );
  names.setFullName( fullName );
  if ( !ConverterContext.getInstance().getInteractorConfig().isExcludeInteractorAliases() ) {
    Collection<? extends Alias> aliases;
    if (aliasConverter.isCheckInitializedCollections()){
      aliases = IntactCore.ensureInitializedAliases(annotatedObject);
    }
    else {
      aliases = annotatedObject.getAliases();
    }
    for ( Alias alias : aliases) {
      names.getAliases().add( aliasConverter.intactToPsi( alias ) );
    }
  }
  namesContainer.setNames( names );
}
origin: uk.ac.ebi.intact.core/intact-core

/**
 * Retrieves the xrefs from an AnnotatedObject, initializing them if necessary.
 *
 * @param ao The annotated object instance with possibly non-initialized xrefs
 * @return The returned xrefs are ensured to be initialized
 * @since 2.4.0
 */
public static Collection<? extends Xref> ensureInitializedXrefs(AnnotatedObject<?, ?> ao) {
  Collection<? extends Xref> xrefs;
  if (IntactCore.isInitialized(ao.getXrefs())) {
    xrefs = ao.getXrefs();
  } else {
    xrefs = IntactContext.getCurrentInstance().getDaoFactory().getXrefDao(AnnotatedObjectUtils.getXrefClassType(ao.getClass()))
        .getByParentAc(ao.getAc());
  }
  return xrefs;
}
uk.ac.ebi.intact.modelAnnotatedObject

Most used methods

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

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onRequestPermissionsResult (Fragment)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • 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