com.mikerusoft.jsonable.annotations.DateField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonable Show documentation
Show all versions of jsonable Show documentation
Small library to convert Java POJO to and from JSON
package com.mikerusoft.jsonable.annotations;
import com.mikerusoft.jsonable.transform.DateTransformer;
import java.lang.annotation.ElementType;
/**
* This Annotation defines field as Date element. Works with {@link com.mikerusoft.jsonable.annotations.JsonField} only.
* There are 2 supported types:
* 1. {@link com.mikerusoft.jsonable.transform.DateTransformer#TIMESTAMP_TYPE} and it's default. Means that date is converted into long represented Timestamp
* 2. {@link com.mikerusoft.jsonable.transform.DateTransformer#STRING_TYPE}. Means default string is returned.
*
* @author Grinfeld Mikhail
* @since 1/5/2015.
*/
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
@java.lang.annotation.Target({ElementType.FIELD, ElementType.METHOD})
public @interface DateField {
int type() default DateTransformer.TIMESTAMP_TYPE;
String format() default "";
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy