protected void writeCvTerm( Writer out, CvObject cv, String indent ) throws IOException { String title = cvtype2name.get( CgLibUtil.removeCglibEnhanced( cv.getClass() ) ); if ( title == null ) { throw new IllegalStateException( "No title has been assigned to CV type: " + cv.getClass().getName() ); } String sl = cv.getShortLabel(); String fn = escapeXml( cv.getFullName() ); writeField( out, title, sl, indent ); // write fullname only if different from shortlabel and not null. if ( !sl.equals( fn ) ) { if ( fn != null && fn.length() > 0 ) { writeField( out, title, fn, indent ); } } String mi = getMiReference( cv ); if ( mi != null ) { writeField( out, title, mi, indent ); } }
public CrossReference toCrossReference( O cvObject ) { if ( cvObject == null ) { throw new IllegalArgumentException( "CvObject must not be null. " ); } // name of the cv is the fullname String text = cvObject.getFullName()!= null ? cvObject.getFullName() : cvObject.getShortLabel(); String identity = cvObject.getIdentifier(); if(identity == null ) { throw new NullPointerException( cvObject.getClass().getSimpleName() + "("+ text +") didn't have an identity" ); } final CvObjectXref idXref = findMatchingIdentityXref(cvObject.getXrefs(), identity); //XrefUtils.getIdentityXref(cvObject, CvDatabase.PSI_MI_MI_REF); if (idXref != null){ try { CrossReference ref = crossRefConverter.createCrossReference(idXref, false); ref.setText(text); return ref; } catch ( Exception e ) { throw new RuntimeException( "An exception occured while building a cv object : " + text, e ); } } else { CrossReference ref = new CrossReferenceImpl(CrossReferenceConverter.DATABASE_UNKNOWN, identity, text); return ref; } }
if ( log.isDebugEnabled() ) log.debug("Created missing CV Term: " + clazz.getSimpleName() + "( " + cv.getShortLabel() + " - " + cv.getFullName() + " ).");
if ( log.isDebugEnabled() ) log.debug("Created missing CV Term: " + clazz.getSimpleName() + "( " + cv.getShortLabel() + " - " + cv.getFullName() + " ).");
log.debug("Created missing CV Term: " + clazz.getSimpleName() + "( " + cv.getShortLabel() + " - " + cv.getFullName() + " ).");
cvObject.getFullName(), CgLibUtil.getRealClassName( cvObject ).getName(), cvObject.getIdentifier(),