Class MinimalPublicationEnricher
- java.lang.Object
-
- psidev.psi.mi.jami.enricher.impl.AbstractMIEnricher<Publication>
-
- psidev.psi.mi.jami.enricher.impl.minimal.MinimalPublicationEnricher
-
- All Implemented Interfaces:
MIEnricher<Publication>
,PublicationEnricher
- Direct Known Subclasses:
FullPublicationEnricher
,MinimalPublicationUpdater
public class MinimalPublicationEnricher extends AbstractMIEnricher<Publication> implements PublicationEnricher
Provides minimal enrichment of Publication. - enrich identifiers (pubmed, doi, etc.) of a publication. It will use DefaultXrefComparator to compare identifiers and add missing identifiers without removing any existing identifiers. - enrich authors of a publication. It will add all missing authors but will not remove any existing authors - enrich publication date. It will only enrich the publication date if it is not already set in the publication to enrich. It will not override any existing publication date It will ignore all other properties of a publication- Since:
- 31/07/13
- Author:
- Gabriel Aldam (galdam@ebi.ac.uk)
-
-
Constructor Summary
Constructors Constructor Description MinimalPublicationEnricher(PublicationFetcher fetcher)
The only constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enrich(Publication publicationToEnrich, Publication publicationFetched)
enrich.Publication
find(Publication publicationToEnrich)
find.PublicationEnricherListener
getPublicationEnricherListener()
Gets the current publication listenerPublicationFetcher
getPublicationFetcher()
Gets the publication fetcher which is currently being used to retrieve entriesint
getRetryCount()
Getter for the fieldretryCount
.protected void
onEnrichedVersionNotFound(Publication publicationToEnrich)
onEnrichedVersionNotFound.protected void
processAuthors(Publication publicationToEnrich, Publication fetched)
processAuthors.protected void
processIdentifiers(Publication publicationToEnrich, Publication fetched)
processIdentifiers.protected void
processOtherProperties(Publication publicationToEnrich, Publication fetchedPublication)
processOtherProperties.void
processPublication(Publication publicationToEnrich, Publication fetchedPublication)
The strategy for the enrichment of the publication.protected void
processPublicationDate(Publication publicationToEnrich, Publication fetched)
processPublicationDate.void
setPublicationEnricherListener(PublicationEnricherListener listener)
setPublicationEnricherListener.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
-
MinimalPublicationEnricher
public MinimalPublicationEnricher(PublicationFetcher fetcher)
The only constructor. It requires a publication fetcher. If the publication fetcher is null, an illegal state exception will be thrown at the next enrichment.- Parameters:
fetcher
- The PublicationFetcher to use.
-
-
Method Detail
-
getPublicationFetcher
public PublicationFetcher getPublicationFetcher()
Gets the publication fetcher which is currently being used to retrieve entries- Specified by:
getPublicationFetcher
in interfacePublicationEnricher
- Returns:
- the current publication fetcher.
-
setPublicationEnricherListener
public void setPublicationEnricherListener(PublicationEnricherListener listener)
setPublicationEnricherListener.
Sets the listener to report publication changes to. Can be null.- Specified by:
setPublicationEnricherListener
in interfacePublicationEnricher
- Parameters:
listener
- aPublicationEnricherListener
object.
-
getPublicationEnricherListener
public PublicationEnricherListener getPublicationEnricherListener()
Gets the current publication listener- Specified by:
getPublicationEnricherListener
in interfacePublicationEnricher
- Returns:
- the current publication listener
-
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.
-
processPublication
public void processPublication(Publication publicationToEnrich, Publication fetchedPublication) throws EnricherException
The strategy for the enrichment of the publication. This methods can be overwritten to change the behaviour of the enrichment.- Parameters:
publicationToEnrich
- The publication which is being enriched.fetchedPublication
- aPublication
object.- Throws:
EnricherException
- if any.
-
processOtherProperties
protected void processOtherProperties(Publication publicationToEnrich, Publication fetchedPublication) throws EnricherException
processOtherProperties.
- Parameters:
publicationToEnrich
- aPublication
object.fetchedPublication
- aPublication
object.- Throws:
EnricherException
- if any.
-
processPublicationDate
protected void processPublicationDate(Publication publicationToEnrich, Publication fetched) throws EnricherException
processPublicationDate.
- Parameters:
publicationToEnrich
- aPublication
object.fetched
- aPublication
object.- Throws:
EnricherException
- if any.
-
processAuthors
protected void processAuthors(Publication publicationToEnrich, Publication fetched) throws EnricherException
processAuthors.
- Parameters:
publicationToEnrich
- aPublication
object.fetched
- aPublication
object.- Throws:
EnricherException
- if any.
-
processIdentifiers
protected void processIdentifiers(Publication publicationToEnrich, Publication fetched) throws EnricherException
processIdentifiers.
- Parameters:
publicationToEnrich
- aPublication
object.fetched
- aPublication
object.- Throws:
EnricherException
- if any.
-
find
public Publication find(Publication publicationToEnrich) throws EnricherException
find.
- Specified by:
find
in classAbstractMIEnricher<Publication>
- Parameters:
publicationToEnrich
- a T object.- Returns:
- a T object.
- Throws:
EnricherException
- if any.
-
onEnrichedVersionNotFound
protected void onEnrichedVersionNotFound(Publication publicationToEnrich) throws EnricherException
onEnrichedVersionNotFound.
- Specified by:
onEnrichedVersionNotFound
in classAbstractMIEnricher<Publication>
- Parameters:
publicationToEnrich
- a T object.- Throws:
EnricherException
- if any.
-
enrich
public void enrich(Publication publicationToEnrich, Publication publicationFetched) throws EnricherException
enrich.
- Specified by:
enrich
in interfaceMIEnricher<Publication>
- Specified by:
enrich
in classAbstractMIEnricher<Publication>
- Parameters:
publicationToEnrich
- a T object.publicationFetched
- a T object.- Throws:
EnricherException
- if any.
-
-