2020-01-16 14:00:34 +01:00
|
|
|
package org.gcube.informationsystem.types.annotations;
|
|
|
|
|
|
|
|
import java.lang.annotation.ElementType;
|
|
|
|
import java.lang.annotation.Retention;
|
|
|
|
import java.lang.annotation.RetentionPolicy;
|
|
|
|
import java.lang.annotation.Target;
|
|
|
|
|
2020-07-07 17:04:25 +02:00
|
|
|
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
|
2020-01-16 14:00:34 +01:00
|
|
|
import org.gcube.informationsystem.model.reference.entities.Entity;
|
|
|
|
import org.gcube.informationsystem.model.reference.entities.Resource;
|
|
|
|
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
2020-02-04 09:30:19 +01:00
|
|
|
import org.gcube.informationsystem.types.TypeMapper;
|
2020-01-16 14:00:34 +01:00
|
|
|
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
|
|
|
|
|
|
|
/**
|
2020-02-04 09:30:19 +01:00
|
|
|
* It is used by {@link TypeMapper} to identify which getter method are
|
2020-01-16 14:00:34 +01:00
|
|
|
* related to and {@link Entity} {@link PropertyDefinition}.
|
|
|
|
* The name of the property is obtained by removing "get" or "is" from method
|
|
|
|
* name and lower casing the first letter.
|
2021-01-20 17:26:13 +01:00
|
|
|
*
|
|
|
|
* @author Luca Frosini (ISTI - CNR)
|
2020-01-16 14:00:34 +01:00
|
|
|
*/
|
|
|
|
@Target(ElementType.TYPE)
|
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
2021-02-18 15:14:24 +01:00
|
|
|
public @interface RelatedResourcesEntry {
|
2020-01-16 14:00:34 +01:00
|
|
|
|
|
|
|
@JsonProperty
|
|
|
|
Class<? extends Resource> source() default Resource.class;
|
|
|
|
|
|
|
|
@SuppressWarnings("rawtypes")
|
|
|
|
@JsonProperty
|
|
|
|
Class<? extends IsRelatedTo> relation() default IsRelatedTo.class;
|
|
|
|
|
|
|
|
@JsonProperty
|
|
|
|
Class<? extends Resource> target() default Resource.class;
|
|
|
|
|
|
|
|
@JsonProperty
|
|
|
|
String description() default "";
|
|
|
|
|
|
|
|
}
|