Ignoring property in json serialization useful for java classes only

This commit is contained in:
Luca Frosini 2021-06-29 17:34:54 +02:00
parent 9217daea21
commit 4124291551
10 changed files with 17 additions and 3 deletions

View File

@ -9,6 +9,7 @@ import java.util.Map;
import java.util.Set;
import org.gcube.com.fasterxml.jackson.annotation.JsonGetter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonInclude;
import org.gcube.com.fasterxml.jackson.annotation.JsonInclude.Include;
import org.gcube.com.fasterxml.jackson.annotation.JsonProperty;
@ -263,6 +264,7 @@ public class TypeImpl implements Type {
}
@Override
@JsonIgnore
public AccessType getAccessType() {
return null;
}

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.impl.entities;
import java.io.StringWriter;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
@ -102,6 +103,7 @@ public class EntityTypeImpl extends TypeImpl implements EntityType {
}
@Override
@JsonIgnore
public AccessType getAccessType() {
if(name.compareTo(Context.NAME)==0) {

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.impl.entities;
import java.util.Set;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.model.reference.entities.Entity;
@ -38,6 +39,7 @@ public class FacetTypeImpl extends EntityTypeImpl implements FacetType {
}
@Override
@JsonIgnore
public AccessType getAccessType() {
return AccessType.FACET;
}

View File

@ -3,6 +3,7 @@ package org.gcube.informationsystem.types.impl.entities;
import java.util.ArrayList;
import java.util.List;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.model.reference.entities.Entity;
@ -84,6 +85,7 @@ public class ResourceTypeImpl extends EntityTypeImpl implements ResourceType {
}
@Override
@JsonIgnore
public AccessType getAccessType() {
return AccessType.RESOURCE;
}

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.impl.properties;
import java.util.Set;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
@ -43,6 +44,7 @@ public final class PropertyTypeImpl<P extends PropertyElement> extends TypeImpl
}
@Override
@JsonIgnore
public AccessType getAccessType() {
if(name.compareTo(PropertyType.NAME)==0) {

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.impl.relations;
import java.lang.reflect.Type;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.model.reference.entities.Facet;
@ -59,6 +60,7 @@ public class ConsistsOfTypeImpl extends RelationTypeImpl<ResourceType, FacetType
}
@Override
@JsonIgnore
public AccessType getAccessType() {
return AccessType.CONSISTS_OF;
}

View File

@ -2,6 +2,7 @@ package org.gcube.informationsystem.types.impl.relations;
import java.lang.reflect.Type;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.model.reference.entities.Resource;
@ -56,6 +57,7 @@ public class IsRelatedToTypeImpl extends RelationTypeImpl<ResourceType, Resource
}
@Override
@JsonIgnore
public AccessType getAccessType() {
return AccessType.IS_RELATED_TO;
}

View File

@ -3,6 +3,7 @@ package org.gcube.informationsystem.types.impl.relations;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnore;
import org.gcube.com.fasterxml.jackson.annotation.JsonTypeName;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
@ -136,6 +137,7 @@ public class RelationTypeImpl<S extends EntityType, T extends EntityType>
}
@Override
@JsonIgnore
public AccessType getAccessType() {
if(name.compareTo(IsParentOf.NAME)==0) {

View File

@ -54,6 +54,7 @@ public interface Type extends IdentifiableElement {
public Set<PropertyDefinition> getProperties();
@JsonIgnore
public AccessType getAccessType();
}

View File

@ -4,7 +4,6 @@ import java.util.Set;
import org.gcube.com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.gcube.com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.gcube.informationsystem.base.reference.AccessType;
import org.gcube.informationsystem.base.reference.entities.EntityElement;
import org.gcube.informationsystem.types.annotations.ISProperty;
import org.gcube.informationsystem.types.impl.entities.EntityTypeImpl;
@ -44,6 +43,4 @@ public interface EntityType extends Type, EntityElement {
/* {@link Type} is just a Java useful class. The type is not created in the IS. Hence the fields must be redefined */
public AccessType getAccessType();
}