protected String elementKey(C intactObject) { return intactObject.getIdentifier() + "_" + intactObject.getClass(); }
private boolean areEqual(CvObject cv1, CvObject cv2) { if ( cv1 == null || cv2 == null ) { return false; } if (cv1.getIdentifier() != null && cv2.getIdentifier() != null) { return cv1.getIdentifier().equals(cv2.getIdentifier()); } return cv1.getShortLabel().equals(cv2.getShortLabel()); }
public static boolean hasIdentity(CvObject cvObject, String psiMi) { if (cvObject.getIdentifier() != null && cvObject.getIdentifier().equals(psiMi)) { return true; } return XrefUtils.hasIdentity(cvObject, psiMi); }
public static boolean hasIdentity(CvObject cvObject, String psiMi) { if (cvObject.getIdentifier() != null && cvObject.getIdentifier().equals(psiMi)) { return true; } return XrefUtils.hasIdentity(cvObject, psiMi); }
/** * Returns a String for a CvObject with this format: <code>MI:XXXX(cvLabel)</code>. * @param cvObject The CvObject to convert to simple string * @return The output String */ public static String cvObjectToSimpleString(CvObject cvObject) { if (cvObject == null) return null; return cvObject.getIdentifier()+"("+cvObject.getShortLabel()+")"; }
private boolean isSearchByLabelEnabled(CvObject cvObject){ if (cvObject.getIdentifier() != null){ return false; } if (hasAnIdentityCrossReference(cvObject)){ return false; } return true; }
/** * Returns a String for a CvObject with this format: <code>MI:XXXX(cvLabel)</code>. * @param cvObject The CvObject to convert to simple string * @return The output String */ public static String cvObjectToSimpleString(CvObject cvObject) { if (cvObject == null) return null; return cvObject.getIdentifier()+"("+cvObject.getShortLabel()+")"; }
public void addIncludedCvObject(CvObject cvObject) { if (cvObject != null) { includedIdentifiers.add(cvObject.getIdentifier()); includedLabels.add(cvObject.getShortLabel()); } }
public void addIncludedCvObject(CvObject cvObject) { if (cvObject != null) { includedIdentifiers.add(cvObject.getIdentifier()); includedLabels.add(cvObject.getShortLabel()); } }
public void addExcludedCvObject(CvObject cvObject) { if (cvObject != null) { excludedIdentifiers.add(cvObject.getIdentifier()); excludedLabels.add(cvObject.getShortLabel()); } }
private boolean isSearchByLabelEnabled(CvObject cvObject){ if (cvObject.getIdentifier() != null){ return false; } if (hasAnIdentityCrossReference(cvObject)){ return false; } return true; }
public void addExcludedCvObject(CvObject cvObject) { if (cvObject != null) { excludedIdentifiers.add(cvObject.getIdentifier()); excludedLabels.add(cvObject.getShortLabel()); } }
private boolean areSameCvObject(CvObject cv1, CvObject cv2) { if (cv1.getIdentifier() != null && cv2.getIdentifier() != null) { return cv1.equals(cv2); } return cv1.getShortLabel().equals(cv2.getShortLabel()); }
private boolean areSameCvObject(CvObject cv1, CvObject cv2) { if (cv1.getIdentifier() != null && cv2.getIdentifier() != null) { return cv1.equals(cv2); } return cv1.getShortLabel().equals(cv2.getShortLabel()); }
@Override public void visitCvObject(CvObject cvObject) { currentNode.setUserObject(cvObject.getClass().getSimpleName()+": "+cvObject.getShortLabel()+" ("+ cvObject.getIdentifier()+")"); }
protected Key keyForCvObject(CvObject cvObject) { String key = cvObject.getIdentifier(); if (key == null) { // search for identity final Collection<CvObjectXref> xrefs = XrefUtils.getIdentityXrefs(cvObject); if (!xrefs.isEmpty()) { key = concatPrimaryIds(xrefs); } else { key = cvObject.getShortLabel(); } } key = cvObject.getClass().getSimpleName() + "__" + key; return new Key(key); }
protected Key keyForCvObject(CvObject cvObject) { String key = cvObject.getIdentifier(); if (key == null) { // search for identity final Collection<CvObjectXref> xrefs = XrefUtils.getIdentityXrefs(cvObject); if (!xrefs.isEmpty()) { key = concatPrimaryIds(xrefs); } else { key = cvObject.getShortLabel(); } } key = cvObject.getClass().getSimpleName() + "__" + key; return new Key(key); }
@PostLoad public void postLoad() { CvObject parent = (CvObject) getParent(); if (parent != null && parent.getIdentifier() != null) { prepareParentMi(); } }
@PostLoad public void postLoad() { CvObject parent = (CvObject) getParent(); if (parent != null && parent.getIdentifier() != null) { prepareParentMi(); } }
public <X extends Xref> void populateWithPsiMi(AnnotatedObject annotatedObject, String psiMi) { this.institution = annotatedObject.getOwner(); Class<? extends Xref> xrefClass = AnnotatedObjectUtils.getXrefClassType(annotatedObject.getClass()); X xref = (X) createPsiMiXref(xrefClass, psiMi); xref.setParent(annotatedObject); if (xref instanceof CvObjectXref) { if (((CvObject)annotatedObject).getIdentifier() == null) { ((CvObjectXref)xref).prepareParentMi(); } } annotatedObject.getXrefs().add(xref); }