Skip to content

Package: JsonLdProperty

JsonLdProperty

Coverage

1: package cz.cvut.kbss.jsonld.annotation;
2:
3: import java.lang.annotation.ElementType;
4: import java.lang.annotation.Retention;
5: import java.lang.annotation.RetentionPolicy;
6: import java.lang.annotation.Target;
7:
8: /**
9: * Allows to configure serialization and deserialization behavior for an attribute annotated by this annotation.
10: */
11: @Retention(RetentionPolicy.RUNTIME)
12: @Target(ElementType.FIELD)
13: public @interface JsonLdProperty {
14:
15: /**
16: * Allows to configure serialization and deserialization access to the property.
17: * <p>
18: * By default, the property is both serialized and deserialized. This can be restricted by making the property
19: * read-only or write-only.
20: *
21: * @return Type of access to annotated property
22: */
23: Access access() default Access.READ_WRITE;
24:
25: /**
26: * Specifies property access options.
27: */
28: enum Access {
29: /**
30: * The property can be written to (deserialization) and read from (serialization).
31: */
32: READ_WRITE,
33: /**
34: * The property can be only read from (serialization).
35: */
36: READ_ONLY,
37: /**
38: * The property can be only written to (deserialization).
39: */
40: WRITE_ONLY
41: }
42: }