|
public class EditForm extends Form
|
səhifə | 5/5 | tarix | 24.12.2023 | ölçüsü | 100,61 Kb. | | #191065 |
| 10-amaliy mashg\'ulot
public class EditForm extends Form {
@Override
public void init(Form form) {
formHelper.updateVisibility(form, settingsService.isVisible(COMP_NAME));
formHelper.updateVisibility(form, settingsService.isVisible(COMP_LAST_NAME));
formHelper.updateVisibility(form, settingsService.isVisible(COMP_BIRTH_DATE));
// ...
}
так же можно updateVisibility убрать в Advice типа Around
@Aspect
public class MyAspect {
@Pointcut("execution(* com.example.demoAspects.EditForm.init() && args(form,..))")
public void callAtInit(Form form) { }
// ...
@Around("callAtInit(form)")
public Object aroundCallAt(ProceedingJoinPoint pjp, Form form) {
formHelper.updateVisibility(form, settingsService.isVisible(COMP_NAME));
formHelper.updateVisibility(form, settingsService.isVisible(COMP_LAST_NAME));
formHelper.updateVisibility(form, settingsService.isVisible(COMP_BIRTH_DATE));
Object retVal = pjp.proceed();
return retVal;
}
и.т.д.
Dostları ilə paylaş: |
|
|