element.setAttribute( XREF_ID, xref.getPrimaryId() ); String sSecondary = xref.getSecondaryId(); if ( null != sSecondary && sSecondary.length() > 0) { element.setAttribute( XREF_SECONDARY, sSecondary );
element.setAttribute( XREF_ID, xref.getPrimaryId() ); String sSecondary = xref.getSecondaryId(); if ( null != sSecondary && sSecondary.length() > 0) { element.setAttribute( XREF_SECONDARY, sSecondary );
element.setAttribute( XREF_ID, xref.getPrimaryId() ); String sSecondary = xref.getSecondaryId(); if ( null != sSecondary ) { element.setAttribute( XREF_SECONDARY, sSecondary );
String sSecondary = xref.getSecondaryId(); if ( null != sSecondary && sSecondary.length() > 0 ) { element.setAttribute( XREF_SECONDARY, sSecondary );
String sSecondary = xref.getSecondaryId(); if ( null != sSecondary && sSecondary.length() > 0) { element.setAttribute( XREF_SECONDARY, sSecondary );
String sSecondary = xref.getSecondaryId(); if ( null != sSecondary ) { element.setAttribute( XREF_SECONDARY, sSecondary );
public CrossReference createCrossReference(Xref xref, boolean withText) { CrossReference ref = null; String db = xref.getCvDatabase() != null ? xref.getCvDatabase().getShortLabel() : DATABASE_UNKNOWN; String id = xref.getPrimaryId(); if (id != null && db != null) { String secondaryId = (withText && xref.getSecondaryId() != null) ? xref.getSecondaryId() : null; String cvXrefQualifier = (withText && xref.getCvXrefQualifier() != null) ? xref.getCvXrefQualifier().getShortLabel() : null; if (secondaryId != null) { ref = new CrossReferenceImpl(db, id, secondaryId); } else if (cvXrefQualifier != null) { ref = new CrossReferenceImpl(db, id, cvXrefQualifier); } else { ref = new CrossReferenceImpl(db, id, null); } } return ref; } }
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }
/** * Note: this does not clone the parent. * * @param xref * @return * @throws uk.ac.ebi.intact.model.clone.IntactClonerException * */ protected Xref cloneXref(Xref xref) throws IntactClonerException { if (xref == null) return null; Class clazz = CgLibUtil.removeCglibEnhanced(xref.getClass()); Xref clone = null; try { final Constructor constructor = clazz.getConstructor(); clone = (Xref) constructor.newInstance(); clonerManager.addClone(xref, clone); clone.setPrimaryId(xref.getPrimaryId()); clone.setSecondaryId(xref.getSecondaryId()); clone.setDbRelease(xref.getDbRelease()); clone.setCvDatabase(clone(xref.getCvDatabase())); clone.setCvXrefQualifier(clone(xref.getCvXrefQualifier())); } catch (Exception e) { throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e); } clone.setParent(clone(xref.getParent())); return clone; }
/** * Note: this does not clone the parent. * * @param xref * @return * @throws uk.ac.ebi.intact.model.clone.IntactClonerException * */ protected Xref cloneXref(Xref xref) throws IntactClonerException { if (xref == null) return null; Class clazz = CgLibUtil.removeCglibEnhanced(xref.getClass()); Xref clone = null; try { final Constructor constructor = clazz.getConstructor(); clone = (Xref) constructor.newInstance(); clonerManager.addClone(xref, clone); clone.setPrimaryId(xref.getPrimaryId()); clone.setSecondaryId(xref.getSecondaryId()); clone.setDbRelease(xref.getDbRelease()); clone.setCvDatabase(clone(xref.getCvDatabase())); clone.setCvXrefQualifier(clone(xref.getCvXrefQualifier())); } catch (Exception e) { throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e); } clone.setParent(clone(xref.getParent())); return clone; }
public static boolean sameXref( Xref x1, Xref x2 ) { if (x1.getAc() != null && x2.getAc() != null) { return x1.getAc().equals(x2.getAc()); } if ( !same( x1.getPrimaryId(), x2.getPrimaryId() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvDatabase(), x2.getCvDatabase() ) ) { return false; } if ( !CvObjectUtils.areEqual( x1.getCvXrefQualifier(), x2.getCvXrefQualifier() ) ) { return false; } if ( !same( x1.getSecondaryId(), x2.getSecondaryId() ) ) { return false; } if ( !same( x1.getDbRelease(), x2.getDbRelease() ) ) { return false; } return true; }
dbRef.setSecondary(intactObject.getSecondaryId()); dbRef.setVersion(intactObject.getDbRelease());