Class MinimalCvTermEnricher<C extends CvTerm>
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher<C>
-
- psidev.psi.mi.jami.enricher.impl.minimal.MinimalCvTermEnricher<C>
-
- All Implemented Interfaces:
CvTermEnricher<C>,MIEnricher<C>
- Direct Known Subclasses:
FullCvTermEnricher,MinimalCvTermUpdater
public class MinimalCvTermEnricher<C extends CvTerm> extends AbstractMIEnricher<C> implements CvTermEnricher<C>
Provides minimal enrichment of cv term. - enrich fullname of CvTerm if not set. It will not override any existing fullName with the one loaded from the fetched CvTerm - enrich identifiers of CvTerm. It will only add missing identifiers and not remove any existing identifiers using DefaultXrefComparator It will ignore all other properties of a CvTerm- Since:
- 08/05/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description MinimalCvTermEnricher(CvTermFetcher<C> cvTermFetcher)A constructor matching super.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidenrich(C cvTermToEnrich, C cvTermFetched)enrich.Cfind(C cvTermToEnrich)find.CvTermEnricherListener<C>getCvTermEnricherListener()The current CvTermEnricherListener.CvTermFetcher<C>getCvTermFetcher()The fetcher to be used for used for fetcher.intgetRetryCount()Getter for the fieldretryCount.protected voidonEnrichedVersionNotFound(C cvTermToEnrich)onEnrichedVersionNotFound.voidprocessCvTerm(C cvTermToEnrich, C cvTermFetched)A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.protected voidprocessFullName(C cvTermToEnrich, C cvTermFetched)processFullName.protected voidprocessIdentifiers(C cvTermToEnrich, C cvTermFetched)processIdentifiers.voidsetCvTermEnricherListener(CvTermEnricherListener<C> listener)setCvTermEnricherListener.voidsetRetryCount(int retryCount)Setter for the fieldretryCount.-
Methods inherited from class psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher
enrich, enrich
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface psidev.psi.mi.jami.enricher.MIEnricher
enrich, enrich
-
-
-
-
Constructor Detail
-
MinimalCvTermEnricher
public MinimalCvTermEnricher(CvTermFetcher<C> cvTermFetcher)
A constructor matching super.- Parameters:
cvTermFetcher- The fetcher to initiate the enricher with. If null, an illegal state exception will be thrown at the next enrichment.
-
-
Method Detail
-
getCvTermFetcher
public CvTermFetcher<C> getCvTermFetcher()
The fetcher to be used for used for fetcher.- Specified by:
getCvTermFetcherin interfaceCvTermEnricher<C extends CvTerm>- Returns:
- The fetcher which is being used for fetching.
-
setCvTermEnricherListener
public void setCvTermEnricherListener(CvTermEnricherListener<C> listener)
setCvTermEnricherListener.
The cvTermEnricherListener to be used. It will be fired at all points where a change is made to the cvTerm- Specified by:
setCvTermEnricherListenerin interfaceCvTermEnricher<C extends CvTerm>- Parameters:
listener- aCvTermEnricherListenerobject.
-
getCvTermEnricherListener
public CvTermEnricherListener<C> getCvTermEnricherListener()
The current CvTermEnricherListener.- Specified by:
getCvTermEnricherListenerin interfaceCvTermEnricher<C extends CvTerm>- Returns:
- the current listener. May be null.
-
getRetryCount
public int getRetryCount()
Getter for the field
retryCount.- Returns:
- a int.
-
setRetryCount
public void setRetryCount(int retryCount)
Setter for the field
retryCount.- Parameters:
retryCount- a int.
-
processCvTerm
public void processCvTerm(C cvTermToEnrich, C cvTermFetched) throws EnricherException
A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.- Parameters:
cvTermToEnrich- the CvTerm to enrichcvTermFetched- a C object.- Throws:
EnricherException- if any.
-
processIdentifiers
protected void processIdentifiers(C cvTermToEnrich, C cvTermFetched) throws EnricherException
processIdentifiers.
- Parameters:
cvTermToEnrich- a C object.cvTermFetched- a C object.- Throws:
EnricherException- if any.
-
processFullName
protected void processFullName(C cvTermToEnrich, C cvTermFetched) throws EnricherException
processFullName.
- Parameters:
cvTermToEnrich- a C object.cvTermFetched- a C object.- Throws:
EnricherException- if any.
-
find
public C find(C cvTermToEnrich) throws EnricherException
find.
- Specified by:
findin classAbstractMIEnricher<C extends CvTerm>- Parameters:
cvTermToEnrich- a T object.- Returns:
- a T object.
- Throws:
EnricherException- if any.
-
onEnrichedVersionNotFound
protected void onEnrichedVersionNotFound(C cvTermToEnrich) throws EnricherException
onEnrichedVersionNotFound.
- Specified by:
onEnrichedVersionNotFoundin classAbstractMIEnricher<C extends CvTerm>- Parameters:
cvTermToEnrich- a T object.- Throws:
EnricherException- if any.
-
enrich
public void enrich(C cvTermToEnrich, C cvTermFetched) throws EnricherException
enrich.
- Specified by:
enrichin interfaceMIEnricher<C extends CvTerm>- Specified by:
enrichin classAbstractMIEnricher<C extends CvTerm>- Parameters:
cvTermToEnrich- a T object.cvTermFetched- a T object.- Throws:
EnricherException- if any.
-
-