Changed '@class' to 'type'
This commit is contained in:
parent
4562d463e8
commit
49c04191db
|
@ -17,13 +17,13 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
@Abstract
|
@Abstract
|
||||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = Element.CLASS_PROPERTY)
|
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = Element.CLASS_PROPERTY)
|
||||||
// @JsonTypeIdResolver(ElementTypeIdResolver.class)
|
// @JsonTypeIdResolver(ElementTypeIdResolver.class)
|
||||||
@TypeMetadata(name = Element.NAME, description = "This is the base class for Element", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = Element.NAME, description = "This is the base type for Element", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface Element extends Serializable {
|
public interface Element extends Serializable {
|
||||||
|
|
||||||
public static final String NAME = "Element"; //Element.class.getSimpleName();
|
public static final String NAME = "Element"; //Element.class.getSimpleName();
|
||||||
|
|
||||||
public static final String CLASS_PROPERTY = "@class";
|
public static final String CLASS_PROPERTY = "type";
|
||||||
|
|
||||||
public static final String SUPERCLASSES_PROPERTY = "@superClasses";
|
public static final String SUPERCLASSES_PROPERTY = "@superClasses";
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
@Abstract
|
@Abstract
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
//@JsonDeserialize(as=EntityElementImpl.class) Do not uncomment to manage subclasses
|
//@JsonDeserialize(as=EntityElementImpl.class) Do not uncomment to manage subclasses
|
||||||
@TypeMetadata(name = EntityElement.NAME, description = "This is the base class for any EntityElement", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = EntityElement.NAME, description = "This is the base type for any EntityElement", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface EntityElement extends Element, IdentifiableElement {
|
public interface EntityElement extends Element, IdentifiableElement {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as=PropertyElementImpl.class)
|
@JsonDeserialize(as=PropertyElementImpl.class)
|
||||||
@TypeMetadata(name = PropertyElement.NAME, description = "This is the base class for any PropertyElement", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = PropertyElement.NAME, description = "This is the base type for any PropertyElement", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface PropertyElement extends Element {
|
public interface PropertyElement extends Element {
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@Abstract
|
@Abstract
|
||||||
//@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses
|
//@JsonDeserialize(as=RelationElementImpl.class) Do not uncomment to manage subclasses
|
||||||
@TypeMetadata(name = RelationElement.NAME, description = "This is the base class for any RelationElement", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = RelationElement.NAME, description = "This is the base type for any RelationElement", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface RelationElement<S extends EntityElement, T extends EntityElement> extends Element, IdentifiableElement {
|
public interface RelationElement<S extends EntityElement, T extends EntityElement> extends Element, IdentifiableElement {
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as = ContextImpl.class)
|
@JsonDeserialize(as = ContextImpl.class)
|
||||||
@TypeMetadata(name = Context.NAME, description = "This class is the used to define a Context", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = Context.NAME, description = "This type is the used to define a Context", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface Context extends EntityElement {
|
public interface Context extends EntityElement {
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as = IsParentOfImpl.class)
|
@JsonDeserialize(as = IsParentOfImpl.class)
|
||||||
@TypeMetadata(name = IsParentOf.NAME, description = "This class is the used to define parental relations between Context", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = IsParentOf.NAME, description = "This type is the used to define parental relations between Context", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface IsParentOf extends RelationElement<Context,Context> {
|
public interface IsParentOf extends RelationElement<Context,Context> {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@TypeMetadata(name = Facet.NAME, description = "This is a dummy class for Facet", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = Facet.NAME, description = "This is a dummy type for Facet", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public class DummyFacet extends FacetImpl implements Facet {
|
public class DummyFacet extends FacetImpl implements Facet {
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@TypeMetadata(name = Resource.NAME, description = "This is a dummy class for Resource", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = Resource.NAME, description = "This is a dummy type for Resource", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public class DummyResource extends ResourceImpl implements Resource {
|
public class DummyResource extends ResourceImpl implements Resource {
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
/**
|
/**
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy class for IsRelatedTo", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is a dummy type for IsRelatedTo", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public class DummyIsRelatedTo<S extends Resource, T extends Resource>
|
public class DummyIsRelatedTo<S extends Resource, T extends Resource>
|
||||||
extends IsRelatedToImpl<S, T> implements IsRelatedTo<S, T>{
|
extends IsRelatedToImpl<S, T> implements IsRelatedTo<S, T>{
|
||||||
|
|
|
@ -156,12 +156,12 @@ public final class PropertyDefinitionImpl implements PropertyDefinition {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getType() {
|
public String getPropertyType() {
|
||||||
return propertyTypeName.toString();
|
return propertyTypeName.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@JsonSetter(value = PropertyDefinition.TYPE_PROPERTY)
|
@JsonSetter(value = PropertyDefinition.PROPERTY_TYPE_PROPERTY)
|
||||||
public void setType(String type) {
|
public void setPropertyType(String type) {
|
||||||
this.propertyTypeName = new PropertyTypeName(type);
|
this.propertyTypeName = new PropertyTypeName(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@Abstract
|
@Abstract
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
@TypeMetadata(name = Type.NAME, description = "This is the base class to define any Type", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = Type.NAME, description = "This is the base type to define any Type", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
//@JsonDeserialize(as=TypeImpl.class) Do not uncomment to manage subclasses
|
//@JsonDeserialize(as=TypeImpl.class) Do not uncomment to manage subclasses
|
||||||
public interface Type extends IdentifiableElement {
|
public interface Type extends IdentifiableElement {
|
||||||
|
|
|
@ -17,7 +17,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonDeserialize(as = EntityTypeImpl.class)
|
@JsonDeserialize(as = EntityTypeImpl.class)
|
||||||
@TypeMetadata(name = EntityType.NAME, description = "This class provides information for any EntityType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = EntityType.NAME, description = "This type provides information for any EntityType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface EntityType extends Type, EntityElement {
|
public interface EntityType extends Type, EntityElement {
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonDeserialize(as = FacetTypeImpl.class)
|
@JsonDeserialize(as = FacetTypeImpl.class)
|
||||||
@TypeMetadata(name = FacetType.NAME, description = "This class provides information for the definition of any FacetType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = FacetType.NAME, description = "This type provides information for the definition of any FacetType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface FacetType extends EntityType {
|
public interface FacetType extends EntityType {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as=ResourceTypeImpl.class)
|
@JsonDeserialize(as=ResourceTypeImpl.class)
|
||||||
@TypeMetadata(name = ResourceType.NAME, description = "This class provides information for the definition of any ResourceType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = ResourceType.NAME, description = "This type provides information for the definition of any ResourceType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface ResourceType extends EntityType {
|
public interface ResourceType extends EntityType {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonDeserialize(as = PropertyDefinitionImpl.class)
|
@JsonDeserialize(as = PropertyDefinitionImpl.class)
|
||||||
@TypeMetadata(name = PropertyDefinition.NAME, description = "This class provides information for the definition of any properties", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = PropertyDefinition.NAME, description = "This type provides information for the definition of any properties", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface PropertyDefinition extends PropertyElement, Comparable<PropertyDefinition> {
|
public interface PropertyDefinition extends PropertyElement, Comparable<PropertyDefinition> {
|
||||||
|
@ -30,7 +30,7 @@ public interface PropertyDefinition extends PropertyElement, Comparable<Property
|
||||||
public static final String MAX_PROPERTY = "max";
|
public static final String MAX_PROPERTY = "max";
|
||||||
public static final String MIN_PROPERTY = "min";
|
public static final String MIN_PROPERTY = "min";
|
||||||
public static final String REGEX_PROPERTY = "regexp";
|
public static final String REGEX_PROPERTY = "regexp";
|
||||||
public static final String TYPE_PROPERTY = "type";
|
public static final String PROPERTY_TYPE_PROPERTY = "propertyType";
|
||||||
|
|
||||||
@ISProperty(name = NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
@ISProperty(name = NAME_PROPERTY, readonly = true, mandatory = true, nullable = false)
|
||||||
public String getName();
|
public String getName();
|
||||||
|
@ -56,7 +56,7 @@ public interface PropertyDefinition extends PropertyElement, Comparable<Property
|
||||||
@ISProperty(name = REGEX_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
@ISProperty(name = REGEX_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
||||||
public String getRegexp();
|
public String getRegexp();
|
||||||
|
|
||||||
@ISProperty(name = TYPE_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
@ISProperty(name = PROPERTY_TYPE_PROPERTY, readonly = false, mandatory = true, nullable = false)
|
||||||
public String getType();
|
public String getPropertyType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonDeserialize(as = PropertyTypeImpl.class)
|
@JsonDeserialize(as = PropertyTypeImpl.class)
|
||||||
@TypeMetadata(name = PropertyType.NAME, description = "This class provides information for any PropertyType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = PropertyType.NAME, description = "This type provides information for any PropertyType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface PropertyType<P extends PropertyElement> extends PropertyElement, Type {
|
public interface PropertyType<P extends PropertyElement> extends PropertyElement, Type {
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as = ConsistsOfTypeImpl.class)
|
@JsonDeserialize(as = ConsistsOfTypeImpl.class)
|
||||||
@TypeMetadata(name = ConsistsOfType.NAME, description = "This class provides information for any ConsistsOfType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = ConsistsOfType.NAME, description = "This type provides information for any ConsistsOfType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface ConsistsOfType extends RelationType<ResourceType, FacetType> {
|
public interface ConsistsOfType extends RelationType<ResourceType, FacetType> {
|
||||||
|
|
|
@ -12,7 +12,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
* @author Luca Frosini (ISTI - CNR)
|
* @author Luca Frosini (ISTI - CNR)
|
||||||
*/
|
*/
|
||||||
@JsonDeserialize(as = IsRelatedToTypeImpl.class)
|
@JsonDeserialize(as = IsRelatedToTypeImpl.class)
|
||||||
@TypeMetadata(name = IsRelatedToType.NAME, description = "This class provides information for any IsRelatedToType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = IsRelatedToType.NAME, description = "This type provides information for any IsRelatedToType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
@Final
|
@Final
|
||||||
public interface IsRelatedToType extends RelationType<ResourceType, ResourceType> {
|
public interface IsRelatedToType extends RelationType<ResourceType, ResourceType> {
|
||||||
|
|
|
@ -19,7 +19,7 @@ import org.gcube.informationsystem.utils.Version;
|
||||||
*/
|
*/
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonDeserialize(as = RelationTypeImpl.class)
|
@JsonDeserialize(as = RelationTypeImpl.class)
|
||||||
@TypeMetadata(name = RelationType.NAME, description = "This class provides information for any RelationType", version = Version.MINIMAL_VERSION_STRING)
|
@TypeMetadata(name = RelationType.NAME, description = "This type provides information for any RelationType", version = Version.MINIMAL_VERSION_STRING)
|
||||||
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
|
||||||
public interface RelationType<S extends EntityType, T extends EntityType>
|
public interface RelationType<S extends EntityType, T extends EntityType>
|
||||||
extends Type, RelationElement<S,T> {
|
extends Type, RelationElement<S,T> {
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class DiscoveryTest {
|
||||||
for(PropertyDefinition propertyDefinition : type.getProperties()) {
|
for(PropertyDefinition propertyDefinition : type.getProperties()) {
|
||||||
if(propertyDefinition.getName().compareTo(PropertyType.PROPERTIES_PROPERTY)==0) {
|
if(propertyDefinition.getName().compareTo(PropertyType.PROPERTIES_PROPERTY)==0) {
|
||||||
logger.debug("{}", propertyDefinition);
|
logger.debug("{}", propertyDefinition);
|
||||||
Assert.assertTrue(propertyDefinition.getType().compareTo("Set<PropertyDefinition>")==0);
|
Assert.assertTrue(propertyDefinition.getPropertyType().compareTo("Set<PropertyDefinition>")==0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String typeDefinitionJsonString = TypeMapper.serializeTypeDefinition(type);
|
String typeDefinitionJsonString = TypeMapper.serializeTypeDefinition(type);
|
||||||
|
|
|
@ -7,6 +7,7 @@ import java.util.Map;
|
||||||
|
|
||||||
import org.gcube.com.fasterxml.jackson.core.JsonParseException;
|
import org.gcube.com.fasterxml.jackson.core.JsonParseException;
|
||||||
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
|
import org.gcube.com.fasterxml.jackson.databind.JsonMappingException;
|
||||||
|
import org.gcube.informationsystem.base.reference.Element;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Property;
|
import org.gcube.informationsystem.model.reference.properties.Property;
|
||||||
import org.gcube.informationsystem.serialization.ElementMapper;
|
import org.gcube.informationsystem.serialization.ElementMapper;
|
||||||
|
@ -53,7 +54,7 @@ public class MetadataTest {
|
||||||
|
|
||||||
String metadataJson =
|
String metadataJson =
|
||||||
"{"
|
"{"
|
||||||
+ "\"@class\":\"Metadata\","
|
+ "\"" + Element.CLASS_PROPERTY + "\":\"Metadata\","
|
||||||
+ "\"createdBy\":\"UNKNOWN_USER\","
|
+ "\"createdBy\":\"UNKNOWN_USER\","
|
||||||
+ "\"lastUpdateBy\":\"UNKNOWN_USER\","
|
+ "\"lastUpdateBy\":\"UNKNOWN_USER\","
|
||||||
+ "\"creationTime\":\"2020-11-09 10:01:25.415 +0000\","
|
+ "\"creationTime\":\"2020-11-09 10:01:25.415 +0000\","
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package org.gcube.informationsystem.types;
|
package org.gcube.informationsystem.types;
|
||||||
|
|
||||||
import org.gcube.informationsystem.base.reference.AccessType;
|
import org.gcube.informationsystem.base.reference.AccessType;
|
||||||
|
import org.gcube.informationsystem.base.reference.Element;
|
||||||
import org.gcube.informationsystem.base.reference.entities.EntityElement;
|
import org.gcube.informationsystem.base.reference.entities.EntityElement;
|
||||||
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
|
import org.gcube.informationsystem.base.reference.properties.PropertyElement;
|
||||||
import org.gcube.informationsystem.contexts.reference.entities.Context;
|
import org.gcube.informationsystem.contexts.reference.entities.Context;
|
||||||
|
@ -8,10 +9,10 @@ import org.gcube.informationsystem.contexts.reference.relations.IsParentOf;
|
||||||
import org.gcube.informationsystem.model.reference.entities.Entity;
|
import org.gcube.informationsystem.model.reference.entities.Entity;
|
||||||
import org.gcube.informationsystem.model.reference.entities.Facet;
|
import org.gcube.informationsystem.model.reference.entities.Facet;
|
||||||
import org.gcube.informationsystem.model.reference.entities.Resource;
|
import org.gcube.informationsystem.model.reference.entities.Resource;
|
||||||
|
import org.gcube.informationsystem.model.reference.properties.Encrypted;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
import org.gcube.informationsystem.model.reference.properties.Metadata;
|
||||||
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
|
import org.gcube.informationsystem.model.reference.properties.PropagationConstraint;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Property;
|
import org.gcube.informationsystem.model.reference.properties.Property;
|
||||||
import org.gcube.informationsystem.model.reference.properties.Encrypted;
|
|
||||||
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
import org.gcube.informationsystem.model.reference.relations.ConsistsOf;
|
||||||
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
import org.gcube.informationsystem.model.reference.relations.IsRelatedTo;
|
||||||
import org.gcube.informationsystem.model.reference.relations.Relation;
|
import org.gcube.informationsystem.model.reference.relations.Relation;
|
||||||
|
@ -206,7 +207,7 @@ public class SerializationTest {
|
||||||
logger.debug("Version {}", typeVersion.toString());
|
logger.debug("Version {}", typeVersion.toString());
|
||||||
logger.info(ElementMapper.marshal(propertyType));
|
logger.info(ElementMapper.marshal(propertyType));
|
||||||
|
|
||||||
String json = "{\"@class\":\"PropertyType\",\"metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"@class\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"Date\"},{\"@class\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$\",\"type\":\"String\"},{\"@class\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"type\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}";
|
String json = "{\"" + Element.CLASS_PROPERTY + "\":\"PropertyType\",\"metadata\":null,\"name\":\"Metadata\",\"description\":\"This class provides metadata per every IdentifiableElement\",\"superClasses\":[\"Property\"],\"properties\":[{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"creationTime\",\"description\":\"Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"Date\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"lastUpdateTime\",\"description\":\"Last Update time. At creation time it assumes the same value of creationTime. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"Date\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"createdBy\",\"description\":\"The user that created the Entity or the Relation. It is initialized at creation time. \",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"String\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"uuid\",\"description\":\"This UUID is be used to identify the Entity or the Relation univocally.\",\"mandatory\":true,\"readonly\":true,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":\"^([a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}){1}$\",\"propertyType\":\"String\"},{\"" + Element.CLASS_PROPERTY + "\":\"PropertyDefinition\",\"name\":\"lastUpdateBy\",\"description\":\"The user that made the last update to the Entity or the Relation. At creation time, it assumes the same value of creator.\",\"mandatory\":true,\"readonly\":false,\"notnull\":true,\"max\":null,\"min\":null,\"regexp\":null,\"propertyType\":\"String\"}],\"accessType\":\"PROPERTY\",\"abstract\":false,\"version\":\"1.0.0\",\"changelog\":{\"1.0.0\":\"First Version\"}}";
|
||||||
logger.info(json);
|
logger.info(json);
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
PropertyType<Metadata> metadataType = (PropertyType<Metadata>) TypeMapper.deserializeTypeDefinition(json);
|
PropertyType<Metadata> metadataType = (PropertyType<Metadata>) TypeMapper.deserializeTypeDefinition(json);
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
{
|
{
|
||||||
"@class": "EService",
|
"type": "EService",
|
||||||
"consistsOf": [
|
"consistsOf": [
|
||||||
{
|
{
|
||||||
"@class": "ConsistsOf",
|
"type": "ConsistsOf",
|
||||||
"propagationConstraint" : {
|
"propagationConstraint" : {
|
||||||
"add": "propagate"
|
"add": "propagate"
|
||||||
},
|
},
|
||||||
"target": {
|
"target": {
|
||||||
"@class": "StateFacet",
|
"type": "StateFacet",
|
||||||
"value": "$state"
|
"value": "$state"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"@class": "IsIdentifiedBy",
|
"type": "IsIdentifiedBy",
|
||||||
"target": {
|
"target": {
|
||||||
"@class": "SoftwareFacet",
|
"type": "SoftwareFacet",
|
||||||
"name": "$name",
|
"name": "$name",
|
||||||
"group": "$group"
|
"group": "$group"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue