public static Alias getGeneName( Collection<Alias> aliases ) { for ( Alias alias : aliases ) { if ( GENE_NAME.equalsIgnoreCase( alias.getType() ) || GENE_NAME_MI_REF.equalsIgnoreCase( alias.getTypeAc() ) ) { return alias; } } return null; }
/** * Collect AliasImpl that match the given type. * * @param aliases a non null collection of aliases * @param type type we are searching for. * @param miRef MI reference of the type we are searching for. * * @return a non null collection. */ public static Collection<Alias> searchByType( Collection<Alias> aliases, String type, String miRef ) { if ( type == null && miRef == null ) { throw new IllegalArgumentException( "You must give either a type of an MI reference (or both)." ); } List<Alias> collected = new ArrayList<Alias>( 2 ); for ( Alias alias : aliases ) { if ( type != null ) { if ( type.equalsIgnoreCase( alias.getType() ) ) { collected.add( alias ); } } else if ( miRef != null ) { if ( miRef.equalsIgnoreCase( alias.getTypeAc() ) ) { collected.add( alias ); } } } return collected; }
final String type = alias.getType(); final String val = alias.getValue(); if(table.getColumn(type) == null)
public psidev.psi.mi.xml254.jaxb.Alias toJaxb( psidev.psi.mi.xml.model.Alias mAlias ) { if ( mAlias == null ) { throw new IllegalArgumentException( "You must give a non null model alias." ); } psidev.psi.mi.xml254.jaxb.Alias jAlias = new psidev.psi.mi.xml254.jaxb.Alias(); // Initialise the JAXB object reading the model // 1. set attributes jAlias.setType( mAlias.getType() ); jAlias.setTypeAc( mAlias.getTypeAc() ); jAlias.setValue( mAlias.getValue() ); return jAlias; } }
public psidev.psi.mi.xml253.jaxb.NamesType.Alias toJaxb( psidev.psi.mi.xml.model.Alias mAlias ) { if ( mAlias == null ) { throw new IllegalArgumentException( "You must give a non null model alias." ); } psidev.psi.mi.xml253.jaxb.NamesType.Alias jAlias = new psidev.psi.mi.xml253.jaxb.NamesType.Alias(); // Initialise the JAXB object reading the model // 1. set attributes jAlias.setType( mAlias.getType() ); jAlias.setTypeAc( mAlias.getTypeAc() ); jAlias.setValue( mAlias.getValue() ); return jAlias; } }
public A psiToIntact(psidev.psi.mi.xml.model.Alias psiObject) { psiStartConversion(psiObject); String name = psiObject.getValue(); String aliasType = psiObject.getType(); String aliasTypeAc = psiObject.getTypeAc(); if (name.length() == 0) { throw new PsiConversionException("Value in Alias is empty: "+psiObject); } CvAliasType cvAliasType = null; // a type ac must always be a mi term if (aliasType != null) { cvAliasType = new CvAliasType(getInstitution(), aliasType); if( aliasTypeAc != null ) { cvAliasType.setIdentifier(aliasTypeAc); psiMiPopulator.populateWithPsiMi(cvAliasType, aliasTypeAc); } else { if ( log.isWarnEnabled() ) log.warn( "Attempting to build an Alias ("+ aliasType + ") without nameAc, this will result in a CvTopic without Xref" ); } } A alias = newAliasInstance(aliasClass, cvAliasType, name); alias.setOwner(getInstitution()); psiEndConversion(psiObject); return alias; }