/** * @author Gunnar Morling */ @ValidateOnExecution(type = ExecutableType.ALL) public interface DeliveryService { public void createDelivery(@NotNull String name); }
/** * @author Gunnar Morling */ @ValidateOnExecution(type = ExecutableType.GETTER_METHODS) public interface OrderService { public Order placeOrder(@NotNull String name); @NotNull public Order getOrder(); }
/** * @author Gunnar Morling */ @ValidateOnExecution(type = ExecutableType.ALL) public interface ShipmentService { public void findShipment(@NotNull String id); @ValidateOnExecution(type = ExecutableType.GETTER_METHODS) @NotNull public Shipment getShipment(); @NotNull public Shipment getAnotherShipment(); }
/** * @author Gunnar Morling */ @ValidateOnExecution(type = ExecutableType.NONE) public class OrderLine { public OrderLine(@NotNull String item) { } public void setItem(@NotNull String item) { } }
@ValidateOnExecution @NotNull public Delivery getDelivery() { return null; }
@ValidateOnExecution(type = ExecutableType.GETTER_METHODS) @NotNull public Shipment getShipment() { return null; }
@Inject @ValidateOnExecution(type = ExecutableType.ALL) public YetAnotherCalendarService(@LongName @Size(min = 5) String name) { } }
@ValidateOnExecution(type = { ExecutableType.ALL, ExecutableType.NONE }) public Event createEvent(@Min(0) float duration) { return new Event(); } }
@Inject @ValidateOnExecution(type = ExecutableType.NON_GETTER_METHODS) public AnotherCalendarService(@LongName @Size(min = 5) String name) { } }
@Inject @ValidateOnExecution public AnotherDeliveryService(@LongName @Size(min = 5) String id) { } }
@Inject @ValidateOnExecution(type = ExecutableType.CONSTRUCTORS) public OnlineCalendarService(@LongName @Size(min = 5) String name) { } }
@ValidateOnExecution(type = ExecutableType.GETTER_METHODS) public Event createEvent(@Min(0) int duration) { return new Event(); } }
@ValidateOnExecution(type = ExecutableType.CONSTRUCTORS) @ValidObject public OfflineCalendarService() { } }
@ValidateOnExecution(type = ExecutableType.NONE) @ValidWarehouseItem public WarehouseItem(@NotNull String name) { }
@ValidateOnExecution(type = ExecutableType.NON_GETTER_METHODS) @ValidObject public Event createEvent(byte duration) { return new Event(); }
@ValidateOnExecution(type = ExecutableType.NON_GETTER_METHODS) @ValidObject public Event getEvent() { return new Event(); }
@ValidateOnExecution(type = ExecutableType.ALL) @ValidObject public Event getVerySpecialEvent() { return new Event(); }
@ValidateOnExecution(type = ExecutableType.GETTER_METHODS) @ValidObject public Event getSpecialEvent() { return new Event(); }
@POST @Path("/booksNoValidate") @ValidateOnExecution(type = ExecutableType.NONE) public Response addBookNoValidation(@NotNull @FormParam("id") String id) { return Response.ok().build(); } @POST
@POST @Path("/booksValidate") @ValidateOnExecution(type = ExecutableType.IMPLICIT) public Response addBookValidate(@NotNull @FormParam("id") String id) { return Response.ok().build(); }