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

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

Best Java code snippets using uk.ac.ebi.intact.model.AnnotatedObject.getAliases (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.core/intact-core

/**
 * Prints the label, ac, and the counts of some attributes (xrefs, aliases and annotations) of an AnnotatedObject
 * @param ao Annotated object to prints
 *
 * @since 1.8.0
 */
public static String annotatedObjectToString(AnnotatedObject ao, boolean showAttributesCount) {
  Class clazz = CgLibUtil.removeCglibEnhanced(ao.getClass());
  StringBuilder sb = new StringBuilder();
  sb.append(clazz.getSimpleName()).append("{label=").append(ao.getShortLabel()).append(", ac=").append(ao.getAc());
  if (showAttributesCount) {
    String xrefsCount = "[not initialized]";
    String aliasCount = "[not initialized]";
    String annotationsCount = "[not initialized]";
    if (IntactCore.isInitialized(ao.getXrefs())) {
      xrefsCount = String.valueOf(ao.getXrefs().size());
    }
    if (IntactCore.isInitialized(ao.getAliases())) {
      aliasCount = String.valueOf(ao.getAliases().size());
    }
    if (IntactCore.isInitialized(ao.getAnnotations())) {
      annotationsCount = String.valueOf(ao.getAnnotations().size());
    }
    sb.append(", xrefCount=").append(xrefsCount).append(", aliasCount=").append(aliasCount).append(", annotationsCount=").append(annotationsCount);
  }
  sb.append("}");
  return sb.toString();
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  Collection<Alias> matchingAliases = new ArrayList<Alias>();
  for (Alias alias : annotatedObject.getAliases()) {
    if (alias.getCvAliasType() != null
        && (
        alias.getCvAliasType().getIdentifier().equals(miOrLabel)
            ||
            alias.getCvAliasType().getShortLabel().equals(miOrLabel))
        ) {
      matchingAliases.add(alias);
    }
  }
  return matchingAliases;
}
origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Prints the label, ac, and the counts of some attributes (xrefs, aliases and annotations) of an AnnotatedObject
 * @param ao Annotated object to prints
 *
 * @since 1.8.0
 */
public static String annotatedObjectToString(AnnotatedObject ao, boolean showAttributesCount) {
  Class clazz = CgLibUtil.removeCglibEnhanced(ao.getClass());
  StringBuilder sb = new StringBuilder();
  sb.append(clazz.getSimpleName()).append("{label=").append(ao.getShortLabel()).append(", ac=").append(ao.getAc());
  if (showAttributesCount) {
    String xrefsCount = "[not initialized]";
    String aliasCount = "[not initialized]";
    String annotationsCount = "[not initialized]";
    if (IntactCore.isInitialized(ao.getXrefs())) {
      xrefsCount = String.valueOf(ao.getXrefs().size());
    }
    if (IntactCore.isInitialized(ao.getAliases())) {
      aliasCount = String.valueOf(ao.getAliases().size());
    }
    if (IntactCore.isInitialized(ao.getAnnotations())) {
      annotationsCount = String.valueOf(ao.getAnnotations().size());
    }
    sb.append(", xrefCount=").append(xrefsCount).append(", aliasCount=").append(aliasCount).append(", annotationsCount=").append(annotationsCount);
  }
  sb.append("}");
  return sb.toString();
}
origin: uk.ac.ebi.intact.core/intact-core

public static Collection<Alias> getAliasByType(AnnotatedObject<?, ?> annotatedObject, String miOrLabel) {
  Collection<Alias> matchingAliases = new ArrayList<Alias>();
  for (Alias alias : annotatedObject.getAliases()) {
    if (alias.getCvAliasType() != null
        && (
        alias.getCvAliasType().getIdentifier().equals(miOrLabel)
            ||
            alias.getCvAliasType().getShortLabel().equals(miOrLabel))
        ) {
      matchingAliases.add(alias);
    }
  }
  return matchingAliases;
}
origin: uk.ac.ebi.intact.core/intact-core

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

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

if (IntactCore.isInitializedAndDirty(ao.getAliases())) {
  for ( Alias alias : ao.getAliases() ) {
    synchedAliases.add( synchronizeAlias( alias, ao ) );
  ao.getAliases().clear();
  ao.getAliases().addAll(synchedAliases);
} else {
  synchedAliases = ao.getAliases();
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

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-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

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

  return IntactCore.isInitialized(parent.getAnnotations());
} else if (child instanceof Alias) {
  return IntactCore.isInitialized(parent.getAliases());
} else {
  throw new IllegalArgumentException("Unexpected combination parent/child - Parent: " +
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-persister

@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() );
  }
}
uk.ac.ebi.intact.modelAnnotatedObjectgetAliases

Popular methods of AnnotatedObject

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

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getSystemService (Context)
  • setRequestProperty (URLConnection)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • ImageIO (javax.imageio)
  • Top Sublime Text plugins
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