All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jboss.resteasy.reactive.DateFormat Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package org.jboss.resteasy.reactive;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.time.format.DateTimeFormatter;
import java.util.function.Supplier;

/**
 * An annotation that can be used on a date JAX-RS Resource method parameter type in order to determine the format
 * that will be used to parse that type.
 *
 * Supported types are:
 *
 * 
    *
  • java.time.LocalDate *
  • java.time.LocalDateTime *
  • java.time.LocalTime *
  • java.time.OffsetDateTime *
  • java.time.OffsetTime *
  • java.time.ZonedDateTime *
*/ @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.PARAMETER) public @interface DateFormat { /** * If set, this string will be used in order to build a {@link DateTimeFormatter} using {@code DateTimeFormatter.ofPattern}. * Subsequently, the built {@link DateTimeFormatter} will be used in order to parse the input String into the desired type. */ String pattern() default UNSET_PATTERN; /** * If set, the class will be used to provide a {@link DateTimeFormatter} that will then be used in order to parse the input * String into the desired type. */ Class dateTimeFormatterProvider() default DateTimeFormatterProvider.UnsetDateTimeFormatterProvider.class; String UNSET_PATTERN = "<>"; interface DateTimeFormatterProvider extends Supplier { class UnsetDateTimeFormatterProvider implements DateTimeFormatterProvider { @Override public DateTimeFormatter get() { throw new IllegalStateException("Should never be called"); } } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy