20 Ocak 2022 Perşembe

Jakarta EE @Decorator Anotasyonu

Örnek
Şöyle yaparız
import javax.annotation.Priority;
import javax.decorator.Decorator;
import javax.decorator.Delegate;
import javax.enterprise.inject.Any;
import javax.inject.Inject;
import javax.interceptor.Interceptor;

@Decorator
@Priority(Interceptor.Priority.APPLICATION)
public class Manager implements Worker {

  @Inject
  @Delegate
  @Any
  private Worker worker;

  @Override
  public String work(String job) {
    return "will delegate to a programmer -> " + worker.work(job);
  }
}


Hiç yorum yok:

Yorum Gönder

Bean Validation @GroupSequence Anotasyonu

Örnek Elimizde şöyle bir kod olsun public class SampleRequest {   @NotNull   LocalDate startDate;   @NotNull   LocalDate endDate;   @AssertT...