private static <A extends Alias> A newAliasInstance(Class<A> aliasClass, CvAliasType aliasType, String name) { A alias = null; try { alias = aliasClass.newInstance(); alias.setCvAliasType(aliasType); alias.setName(name); } catch (Exception e) { throw new PsiConversionException(e); } return alias; } }
/** * Create a new Alias for the given Annotated object * * @param annotatedObject the object to which we'll add a new Alias * @param cvAliasType the CvAliasType (may be null) * @param name the name of the alias (namy be null) * * @see uk.ac.ebi.intact.model.CvAliasType * @see uk.ac.ebi.intact.model.AnnotatedObject */ public Alias( AnnotatedObject annotatedObject, CvAliasType cvAliasType, String name ) { super(); setParentAc( annotatedObject.getAc() ); setCvAliasType( cvAliasType ); setName( name ); }
protected Alias cloneAlias(Alias alias) throws IntactClonerException { if (alias == null) return null; Class clazz = CgLibUtil.removeCglibEnhanced(alias.getClass()); Alias clone = null; try { final Constructor constructor = clazz.getConstructor(); clone = (Alias) constructor.newInstance(); clonerManager.addClone(alias, clone); clone.setCvAliasType(clone(alias.getCvAliasType())); clone.setName(alias.getName()); } catch (Exception e) { throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e); } return clone; }
protected Alias cloneAlias(Alias alias) throws IntactClonerException { if (alias == null) return null; Class clazz = CgLibUtil.removeCglibEnhanced(alias.getClass()); Alias clone = null; try { final Constructor constructor = clazz.getConstructor(); clone = (Alias) constructor.newInstance(); clonerManager.addClone(alias, clone); clone.setCvAliasType(clone(alias.getCvAliasType())); clone.setName(alias.getName()); } catch (Exception e) { throw new IntactClonerException("An error occured upon building a " + clazz.getSimpleName(), e); } return clone; }
public static <A extends Alias> A createAlias(AnnotatedObject<?, A> parent, String name, CvAliasType aliasType) { A alias = (A) newAliasInstanceFor(parent.getClass()); alias.setOwner(parent.getOwner()); alias.setParent(parent); alias.setCvAliasType(aliasType); alias.setName(name); return alias; }
public static <A extends Alias> A createAlias(AnnotatedObject<?, A> parent, String name, CvAliasType aliasType) { A alias = (A) newAliasInstanceFor(parent.getClass()); alias.setOwner(parent.getOwner()); alias.setParent(parent); alias.setCvAliasType(aliasType); alias.setName(name); return alias; }
/** * Create a new Alias for the given Annotated object * * @param annotatedObject the object to which we'll add a new Alias * @param cvAliasType the CvAliasType (may be null) * @param name the name of the alias (namy be null) * * @see uk.ac.ebi.intact.model.CvAliasType * @see uk.ac.ebi.intact.model.AnnotatedObject */ public Alias( AnnotatedObject annotatedObject, CvAliasType cvAliasType, String name ) { super(); setParentAc( annotatedObject.getAc() ); setCvAliasType( cvAliasType ); setName( name ); }
public static <A extends Alias> A createAlias(AnnotatedObject<?,A> parent, String name, CvAliasType aliasType) { A alias = (A) newAliasInstanceFor(parent.getClass()); alias.setOwner(parent.getOwner()); alias.setParent(parent); alias.setCvAliasType(aliasType); alias.setName(name); return alias; }
/** * Create a new Alias for the given Annotated object * * @param anOwner The institution owning this Alias * @param annotatedObject the object to which we'll add a new Alias * @param cvAliasType the CvAliasType (may be null) * @param name the name of the alias (namy be null) * * @see uk.ac.ebi.intact.model.CvAliasType * @see uk.ac.ebi.intact.model.AnnotatedObject */ public Alias( Institution anOwner, AnnotatedObject annotatedObject, CvAliasType cvAliasType, String name ) { setOwner( anOwner ); setParentAc( annotatedObject.getAc() ); setCvAliasType( cvAliasType ); setName( name ); }