mercredi 6 février 2019

How can I make getter's call mandatory in the same class

I have this code: How could I make the use of the getService() method mandatory in the getAll methode, that means if I call directly service.findAll() compilation fails ?

@Named
@Profile("default")
public class AlfrescoVersionServiceImpl  {

   @Inject
   private AlfrescoService service;

   @Resource
   private WebServiceContext webServiceContext;


   public List<Fichier> getAll(){
       return getService().findAll();
   }


   public AlfrescoService getService(){
       service.setEnPointAdress("--");
       if(webServiceContext.isUserInRole(role)){
           service.setRole("--");
       }
   }


}

Thank you in advance for your reply.

Aucun commentaire:

Enregistrer un commentaire