Removed final modifier from some methods since CDI does not support

final methods
master
Jens Pelzetter 2023-01-24 20:45:56 +01:00
parent 7fcdb4a967
commit 9e252145f0
3 changed files with 87 additions and 7 deletions

View File

@ -19,9 +19,20 @@ public abstract class AbstractPublicationImExporter<T extends Publication>
@Inject
private PublicationRepository publicationRepo;
/**
* Implementation of {@link AbstractEntityImExporter#init() }
* for subtypes of {@link Publication}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method. Instead, they MUST implement
* {@link #initPublicationImExporter()}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*/
@Override
@PostConstruct
protected final void init() {
protected void init() {
initPublicationImExporter();
}
@ -37,8 +48,23 @@ public abstract class AbstractPublicationImExporter<T extends Publication>
publicationRepo.save(publication);
}
/**
* Implementation of
* {@link AbstractEntityImExporter#updateExistingEntity(org.libreccm.imexport.Exportable, org.libreccm.imexport.Exportable)}
* for subtypes of {@link Publication}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method.Instead, they MUST implement
* {@link #updateExistingPublication(org.scientificcms.publications.Publication, org.scientificcms.publications.Publication)}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*
* @param existingEntity Exiting publication.
* @param importedEntity Imported publication.
*/
@Override
protected final void updateExistingEntity(
protected void updateExistingEntity(
final T existingEntity,
final T importedEntity
) {

View File

@ -11,8 +11,20 @@ import java.util.Set;
public abstract class AbstractPublicationWithPublisherImExporter<T extends PublicationWithPublisher>
extends AbstractPublicationImExporter<T> {
/**
* Implementation of
* {@link AbstractPublicationImExporter#initPublicationImExporter()} for
* subtypes of {@link PublicationWithPublisher}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method. Instead, they MUST implement
* {@link #initPublicationWithPublisherImExporter()}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*/
@Override
protected final void initPublicationImExporter() {
protected void initPublicationImExporter() {
addRequiredEntities(
Set.of(
Publisher.class
@ -23,8 +35,23 @@ public abstract class AbstractPublicationWithPublisherImExporter<T extends Publi
protected abstract void initPublicationWithPublisherImExporter();
/**
* Implementation of
* {@link AbstractPublicationImExporter#updateExistingPublication(org.scientificcms.publications.Publication, org.scientificcms.publications.Publication)}
* for subtypes of {@link PublicationWithPublisher}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method.Instead, they MUST implement
* {@link #updateExistingPublicationWithPublisher(org.scientificcms.publications.PublicationWithPublisher, org.scientificcms.publications.PublicationWithPublisher)}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*
* @param existingPublication Exiting publication.
* @param withImportedPublication Imported publication.
*/
@Override
protected final void updateExistingPublication(
protected void updateExistingPublication(
final T existingPublication,
final T withImportedPublication
) {

View File

@ -13,8 +13,20 @@ import java.util.Set;
public abstract class AbstractUnPublishedImExporter<T extends UnPublished>
extends AbstractPublicationImExporter<T> {
/**
* Implementation of
* {@link AbstractPublicationImExporter#initPublicationImExporter()} for
* subtypes of {@link UnPublished}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method. Instead, they MUST implement
* {@link #initUnPublishedImExporter()}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*/
@Override
protected final void initPublicationImExporter() {
protected void initPublicationImExporter() {
addRequiredEntities(
Set.of(Organization.class)
);
@ -24,8 +36,23 @@ public abstract class AbstractUnPublishedImExporter<T extends UnPublished>
protected abstract void initUnPublishedImExporter();
/**
* Implementation of
* {@link AbstractPublicationImExporter#updateExistingPublication(org.scientificcms.publications.Publication, org.scientificcms.publications.Publication)}
* for subtypes of {@link UnPublished}.
*
* !!!Warning: Implementations of this abstract class MUST NEVER override
* this method.Instead, they MUST implement
* {@link #updateExistingUnPublished(org.scientificcms.publications.UnPublished, org.scientificcms.publications.UnPublished)}.
*
* Unfortunetly, CDI does not support final methods, therefore we can't make
* this method final.
*
* @param existingPublication Exiting publication.
* @param withImportedPublication Imported publication.
*/
@Override
protected final void updateExistingPublication(
protected void updateExistingPublication(
final T existingPublication,
final T withImportedPublication
) {