uk.ac.ebi.intact.model.Annotation.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(9.3k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中uk.ac.ebi.intact.model.Annotation.<init>()方法的一些代码示例,展示了Annotation.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Annotation.<init>()方法的具体详情如下:
包路径:uk.ac.ebi.intact.model.Annotation
类名称:Annotation
方法名:<init>

Annotation.<init>介绍

[英]This constructor should not be used as it could result in objects with invalid state. It is here for object mapping purposes only and if possible will be made private.
[中]

代码示例

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

public Annotation createAnnotation(String annotationText, CvTopic cvTopic) {
  Annotation annotation = new Annotation(institution, cvTopic);
  annotation.setAnnotationText(annotationText);
  return annotation;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

public Annotation createAnnotation(String annotationText, CvTopic cvTopic) {
  Annotation annotation = new Annotation(institution, cvTopic);
  annotation.setAnnotationText(annotationText);
  return annotation;
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

public Annotation createAnnotation(String annotationText, CvTopic cvTopic) {
  Annotation annotation = new Annotation(institution, cvTopic);
  annotation.setAnnotationText(annotationText);
  return annotation;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

private void markAsHidden(CvObject cv, CvTopic hidden) {
  final Annotation hiddenAnnotation = new Annotation(hidden, null);
  cv.addAnnotation(hiddenAnnotation);
  corePersister.saveOrUpdate(cv);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

private void addUsedInClass(CvObject cv, CvTopic usedInClass, String classes) {
  final Annotation hiddenAnnotation = new Annotation(usedInClass, classes);
  cv.addAnnotation(hiddenAnnotation);
  corePersister.saveOrUpdate(cv);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

private void markAsHidden(CvObject cv, CvTopic hidden) {
  final Annotation hiddenAnnotation = new Annotation(hidden, null);
  cv.addAnnotation(hiddenAnnotation);
  corePersister.saveOrUpdate(cv);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

private void addUsedInClass(CvObject cv, CvTopic usedInClass, String classes) {
  final Annotation hiddenAnnotation = new Annotation(usedInClass, classes);
  cv.addAnnotation(hiddenAnnotation);
  corePersister.saveOrUpdate(cv);
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

private void addObsoleteAnnotation( CvObject existingCv, String obsoleteMessage ) {
  obsoleteTopic.addAnnotation( new Annotation( existingCv.getOwner(), obsoleteTopic, obsoleteMessage ) );
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

/**
 * Adds the 'on-hold' to a publication.
 *
 * @param intactContext The IntactContext as accessing data is necessary
 * @param publication the publication to hold
 * @param reason the reason for the 'on-hold' status
 * @since 2.5.0
 */
public static void markAsOnHold(IntactContext intactContext, Publication publication, String reason) {
  CvTopic onholdTopic = intactContext.getDaoFactory().getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.ON_HOLD);
  if (onholdTopic == null) throw new IllegalStateException("CvTopic on-hold was not found in the database");
  Annotation annotation = new Annotation(onholdTopic, reason);
  publication.addAnnotation(annotation);
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

/**
 * Adds the 'on-hold' to a publication.
 *
 * @param intactContext The IntactContext as accessing data is necessary
 * @param publication the publication to hold
 * @param reason the reason for the 'on-hold' status
 * @since 2.5.0
 */
public static void markAsOnHold(IntactContext intactContext, Publication publication, String reason) {
  CvTopic onholdTopic = intactContext.getDaoFactory().getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.ON_HOLD);
  if (onholdTopic == null) throw new IllegalStateException("CvTopic on-hold was not found in the database");
  Annotation annotation = new Annotation(onholdTopic, reason);
  publication.addAnnotation(annotation);
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

protected Annotation toAnnotation( String cvTopic, String annotation ) {
  Institution owner = IntactContext.getCurrentInstance().getInstitution();
  CvTopic topic = getCvObjectByLabel( CvTopic.class, cvTopic );
  if ( topic == null ) {
    if ( CvTopic.URL.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.URL_MI_REF, CvTopic.URL );
    } else if ( CvTopic.SEARCH_URL.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.SEARCH_URL_MI_REF, CvTopic.SEARCH_URL );
    } else if ( CvTopic.XREF_VALIDATION_REGEXP.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.XREF_VALIDATION_REGEXP_MI_REF, CvTopic.XREF_VALIDATION_REGEXP );
    } else if ( CvTopic.COMMENT.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.COMMENT_MI_REF, CvTopic.COMMENT );
    } else if ( CvTopic.OBSOLETE.equalsIgnoreCase( cvTopic ) ) {
      topic = CvObjectUtils.createCvObject( owner, CvTopic.class, CvTopic.OBSOLETE_MI_REF, CvTopic.OBSOLETE );
      topic.setFullName( CvTopic.OBSOLETE );
    } else {
      log.error( "Unexpected topic found on annotation: " + cvTopic );
      return null;
    }
  }
  if ( log.isTraceEnabled() )
    log.debug( "Returning from toAnnotation: owner: " + owner + "  topic: " + topic + " annotation  " + annotation );
  return new Annotation( owner, topic, annotation );
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

protected Annotation cloneAnnotation(Annotation annotation) throws IntactClonerException {
  if (annotation == null) return null;
  Annotation clone = new Annotation();
  clonerManager.addClone(annotation, clone);
  clone.setCvTopic(clone(annotation.getCvTopic()));
  clone.setAnnotationText(annotation.getAnnotationText());
  return clone;
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

protected Annotation cloneAnnotation(Annotation annotation) throws IntactClonerException {
  if (annotation == null) return null;
  Annotation clone = new Annotation();
  clonerManager.addClone(annotation, clone);
  clone.setCvTopic(clone(annotation.getCvTopic()));
  clone.setAnnotationText(annotation.getAnnotationText());
  return clone;
}

代码示例来源:origin: uk.ac.ebi.intact/intact-core

Annotation a = new Annotation( owner, topic, text );

代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-datasets-update

/**
 *
 * @return a new Dataset annotation with the dataset value contained in the DatasetSelector of this object
 */
private Annotation createNewDataset() throws DatasetException {
  CvTopic dataset = IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getCvObjectDao( CvTopic.class ).getByPsiMiRef( CvTopic.DATASET_MI_REF );
  if (dataset == null){
    throw new DatasetException("The CVTopic " + CvTopic.DATASET_MI_REF + " : " + CvTopic.DATASET + "doesn't exist in the database.");
  }
  Annotation annotation = new Annotation(dataset, this.selector.getDatasetValueToAdd());
  return annotation;
}

代码示例来源:origin: uk.ac.ebi.intact.dbupdate/intact-cv-update

public static Annotation hideTerm(CvObject c, String message){
  DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory();
  CvTopic topicFromDb = factory.getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.HIDDEN);
  if (topicFromDb == null){
    topicFromDb = CvObjectUtils.createCvObject(IntactContext.getCurrentInstance().getInstitution(), CvTopic.class, null, CvTopic.HIDDEN);
    IntactContext.getCurrentInstance().getCorePersister().saveOrUpdate(topicFromDb);
  }
  Annotation newAnnotation = new Annotation(topicFromDb, message);
  c.addAnnotation(newAnnotation);
  return newAnnotation;
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange.psimi/intact-psixml-converters

public Annotation psiToIntact(Attribute psiObject) {
  psiStartConversion(psiObject);
  CvTopic cvTopic = new CvTopic(getInstitution(), psiObject.getName());
  // all name Acs should be from psi mi controlled vocabularies
  if (psiObject.getNameAc() != null) {
    cvTopic.setIdentifier(psiObject.getNameAc());
    psiMiPopulator.populateWithPsiMi(cvTopic, psiObject.getNameAc());
  }
  Annotation annotation = new Annotation(getInstitution(), cvTopic, psiObject.getValue());
  psiEndConversion(psiObject);
  return annotation;
}

代码示例来源:origin: uk.ac.ebi.intact.dataexchange/intact-cvutils

protected void updateCVsUsingAnnotationDataset(List<CvDagObject> allCvs, AnnotationInfoDataset annotationInfoDataset, CorePersister corePersister) {
  for ( CvDagObject cvObject : allCvs ) {
    final String identity = CvObjectUtils.getIdentity( cvObject );
    if ( identity != null && annotationInfoDataset.containsCvAnnotation( identity ) ) {
      AnnotationInfo annotInfo = annotationInfoDataset.getCvAnnotation( identity );
      // check if the topic has already been processed
      CvTopic topic = createdNonMiTopics.get(annotInfo.getTopicShortLabel());
      // if not, try to get it from the database
      if (topic == null) {
        topic = IntactContext.getCurrentInstance().getDataContext().getDaoFactory()
              .getCvObjectDao(CvTopic.class).getByShortLabel(CvTopic.class, annotInfo.getTopicShortLabel());
        // if it is not in the database, create it and persist it.
        if (topic == null) {
          topic = CvObjectUtils.createCvObject( IntactContext.getCurrentInstance().getInstitution(),
                               CvTopic.class,
                               null,
                               annotInfo.getTopicShortLabel() );
          corePersister.saveOrUpdate(topic);
        }
        // now it has been created
        createdNonMiTopics.put(annotInfo.getTopicShortLabel(), topic);
      }
      // create the corresponding annotation
      Annotation annotation = new Annotation( IntactContext.getCurrentInstance().getInstitution(), topic, annotInfo.getReason() );
      addAnnotation( annotation, cvObject, annotInfo.isApplyToChildren() );
    }
  }
}

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core-readonly

CvTopic cvAddress = new CvTopic("postaladdress");
Annotation annotation = new Annotation( cvAddress, address);
institution.addAnnotation(annotation);

代码示例来源:origin: uk.ac.ebi.intact.core/intact-core

CvTopic cvAddress = new CvTopic("postaladdress");
Annotation annotation = new Annotation( cvAddress, address);
institution.addAnnotation(annotation);

相关文章