public Bibref( Xref xref ) { setXref( xref ); }
public psidev.psi.mi.xml.model.Bibref fromJaxb( psidev.psi.mi.xml254.jaxb.Bibref jBibref ) { if ( jBibref == null ) { throw new IllegalArgumentException( "You must give a non null JAXB Bibref." ); } psidev.psi.mi.xml.model.Bibref mBibref = new psidev.psi.mi.xml.model.Bibref(); // 1. set attributes // 2. set encapsulated objects boolean foundAttributeList = false; boolean foundXref = false; if ( jBibref.getAttributeList() != null ) { foundAttributeList = true; for ( psidev.psi.mi.xml254.jaxb.Attribute jAttribute : jBibref.getAttributeList().getAttributes() ) { mBibref.getAttributes().add( attributeConverter.fromJaxb( jAttribute ) ); } } if ( jBibref.getXref() != null ) { foundXref = true; mBibref.setXref( xrefConverter.fromJaxb( jBibref.getXref() ) ); } if( foundAttributeList && foundXref ) { throw new IllegalArgumentException( "When defining a <bibref>, you must give as a child tag either an <xref> or an <attributeList>." ); } return mBibref; }
public psidev.psi.mi.xml.model.Bibref fromJaxb( psidev.psi.mi.xml253.jaxb.BibrefType jBibref ) { if ( jBibref == null ) { throw new IllegalArgumentException( "You must give a non null JAXB Bibref." ); } psidev.psi.mi.xml.model.Bibref mBibref = new psidev.psi.mi.xml.model.Bibref(); // 1. set attributes // 2. set encapsulated objects boolean foundAttributeList = false; boolean foundXref = false; if ( jBibref.getAttributeList() != null ) { foundAttributeList = true; for ( psidev.psi.mi.xml253.jaxb.AttributeListType.Attribute jAttribute : jBibref.getAttributeList().getAttributes() ) { mBibref.getAttributes().add( attributeConverter.fromJaxb( jAttribute ) ); } } if ( jBibref.getXref() != null ) { foundXref = true; mBibref.setXref( xrefConverter.fromJaxb( jBibref.getXref() ) ); } if( foundAttributeList && foundXref ) { throw new IllegalArgumentException( "When defining a <bibref>, you must give as a child tag either an <xref> or an <attributeList>." ); } return mBibref; }
private boolean extractPrimaryRefFromExperiment(Experiment intactObject, Bibref bibref) { if (!intactObject.getXrefs().isEmpty()){ Collection<uk.ac.ebi.intact.model.Xref> primaryRefs = searchXrefs(intactObject, CvDatabase.PUBMED_MI_REF, CvXrefQualifier.PRIMARY_REFERENCE_MI_REF, isCheckInitializedCollections()); if (primaryRefs.isEmpty()){ primaryRefs = searchXrefs(intactObject, CvDatabase.DOI_MI_REF, CvXrefQualifier.PRIMARY_REFERENCE_MI_REF, isCheckInitializedCollections()); } if (!primaryRefs.isEmpty()){ Iterator<uk.ac.ebi.intact.model.Xref> iterator = primaryRefs.iterator(); uk.ac.ebi.intact.model.Xref primaryRef = iterator.next(); Xref xref = new Xref(); xref.setPrimaryRef(new DbReference(primaryRef.getCvDatabase().getShortLabel(), primaryRef.getCvDatabase().getIdentifier(), primaryRef.getPrimaryId(), primaryRef.getCvXrefQualifier().getShortLabel(), primaryRef.getCvXrefQualifier().getIdentifier())); bibref.setXref(xref); while (iterator.hasNext()){ primaryRef = iterator.next(); xref.getSecondaryRef().add(new DbReference(primaryRef.getCvDatabase().getShortLabel(), primaryRef.getCvDatabase().getIdentifier(), primaryRef.getPrimaryId(), primaryRef.getCvXrefQualifier().getShortLabel(), primaryRef.getCvXrefQualifier().getIdentifier())); } return true; } } return false; }
Xref xref = new Xref(); xref.setPrimaryRef(new DbReference(CvDatabase.PUBMED, CvDatabase.PUBMED_MI_REF, publication.getShortLabel(), CvXrefQualifier.PRIMARY_REFERENCE, CvXrefQualifier.PRIMARY_REFERENCE_MI_REF)); bibref.setXref(xref); isBibRefSet = true;