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 void
enrich(C cvTermToEnrich, C cvTermFetched)
enrich.C
find(C cvTermToEnrich)
find.CvTermEnricherListener<C>
getCvTermEnricherListener()
The current CvTermEnricherListener.CvTermFetcher<C>
getCvTermFetcher()
The fetcher to be used for used for fetcher.int
getRetryCount()
Getter for the fieldretryCount
.protected void
onEnrichedVersionNotFound(C cvTermToEnrich)
onEnrichedVersionNotFound.void
processCvTerm(C cvTermToEnrich, C cvTermFetched)
A method that can be overridden to add to or change the behaviour of enrichment without effecting fetching.protected void
processFullName(C cvTermToEnrich, C cvTermFetched)
processFullName.protected void
processIdentifiers(C cvTermToEnrich, C cvTermFetched)
processIdentifiers.void
setCvTermEnricherListener(CvTermEnricherListener<C> listener)
setCvTermEnricherListener.void
setRetryCount(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:
getCvTermFetcher
in 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:
setCvTermEnricherListener
in interfaceCvTermEnricher<C extends CvTerm>
- Parameters:
listener
- aCvTermEnricherListener
object.
-
getCvTermEnricherListener
public CvTermEnricherListener<C> getCvTermEnricherListener()
The current CvTermEnricherListener.- Specified by:
getCvTermEnricherListener
in 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:
find
in 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:
onEnrichedVersionNotFound
in 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:
enrich
in interfaceMIEnricher<C extends CvTerm>
- Specified by:
enrich
in classAbstractMIEnricher<C extends CvTerm>
- Parameters:
cvTermToEnrich
- a T object.cvTermFetched
- a T object.- Throws:
EnricherException
- if any.
-
-