Improved descriptions to produce a better documentation

This commit is contained in:
Luca Frosini 2023-01-20 11:22:52 +01:00
parent c4bb0ffcf3
commit 8771c62ed1
13 changed files with 37 additions and 36 deletions

View File

@ -23,7 +23,7 @@ public interface EntityElement extends Element, IdentifiableElement {
public static final String NAME = "EntityElement"; //Entity.class.getSimpleName();
/* Overriding getHeader method to create Header property in type */
@ISProperty(name=HEADER_PROPERTY, mandatory=true, nullable=false)
@ISProperty(name=HEADER_PROPERTY, mandatory=true, nullable=false, description="Metadata associated with the instance that is automatically created/updated by the system.")
@Override
public Header getHeader();

View File

@ -17,7 +17,7 @@ import org.gcube.informationsystem.utils.Version;
*/
@Abstract
//@JsonDeserialize(as=EntityImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = Entity.NAME, description = "This is the base class for Entities", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Entity.NAME, description = "This is the base type for any Entity", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Entity extends EntityElement, ERElement {

View File

@ -19,7 +19,7 @@ import org.gcube.informationsystem.utils.Version;
*/
@Abstract
// @JsonDeserialize(as=FacetImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = "Facet", description = "This is the base class for Facets", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = "Facet", description = "This is the base type for any Facet", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Facet extends Entity, SchemaMixedElement {

View File

@ -34,7 +34,7 @@ import org.gcube.informationsystem.utils.Version;
@RelatedResourcesEntry(source=Resource.class, relation=IsRelatedTo.class, target=Resource.class, description="Any Resource can be related to any other resource.")
}
)
@TypeMetadata(name = Resource.NAME, description = "This is the base class for Resources", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Resource.NAME, description = "This is the base type for any Resource", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Resource extends Entity {

View File

@ -13,14 +13,15 @@ import org.gcube.informationsystem.utils.Version;
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=EncryptedImpl.class)
@TypeMetadata(name = Encrypted.NAME, description = "This is the base class for Encrypted values", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Encrypted.NAME, description = "This type is used to properly manage encrypted values across contexts.", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Encrypted extends Property {
public static final String NAME = "Encrypted"; // Encrypted.class.getSimpleName();
public static final String VALUE = "value";
@ISProperty(name=VALUE, readonly=false, mandatory=true, nullable=false)
@ISProperty(name=VALUE, readonly=false, mandatory=true, nullable=false, description = "The value to store encrypted in the IS")
@JsonGetter(value=VALUE)
public String getEncryptedValue();

View File

@ -21,7 +21,7 @@ import org.gcube.informationsystem.utils.Version;
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=HeaderImpl.class)
@TypeMetadata(name = Header.NAME, description = "This class provides metadata per every IdentifiableElement", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Header.NAME, description = "This type provides metadata per every IdentifiableElement", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Header extends Property {
@ -44,24 +44,23 @@ public interface Header extends Property {
*/
public static final String __CONTEXTS = "contexts";
@ISProperty(name = CREATED_BY_PROPERTY, description = "The user that created the Entity or the Relation. It is initialized at Creation Time.", readonly = true, mandatory = true, nullable = false)
public String getCreatedBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = CREATION_TIME_PROPERTY, description = "Creation time. It is represented in the format " + Element.DATETIME_PATTERN + ".", readonly = true, mandatory = true, nullable = false)
public Date getCreationTime();
@ISProperty(name = LAST_UPDATE_BY_PROPERTY, description = "The user that made the last update to the Entity or the Relation. At Creation Time, it assumes the same value of " + CREATED_BY_PROPERTY + ".", mandatory = true, nullable = false)
public String getLastUpdateBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = LAST_UPDATE_TIME_PROPERTY, description = "Last Update time. At creation time it assumes the same value of " + CREATION_TIME_PROPERTY + ". It is represented in the format " + Element.DATETIME_PATTERN, mandatory = true, nullable = false)
public Date getLastUpdateTime();
@ISProperty(name = UUID_PROPERTY, description = "This UUID is be used to identify the Entity or the Relation univocally.", readonly = true, mandatory = true, nullable = false)
public UUID getUUID();
public void setUUID(UUID uuid);
@ISProperty(name = CREATED_BY_PROPERTY, description = "The user that created the Entity or the Relation. It is initialized at creation time. ", readonly = true, mandatory = true, nullable = false)
public String getCreatedBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = CREATION_TIME_PROPERTY, description = "Creation time. It represents the difference, measured in milliseconds, between the creation time and midnight, January 1, 1970, UTC.", readonly = true, mandatory = true, nullable = false)
public Date getCreationTime();
@ISProperty(name = LAST_UPDATE_BY_PROPERTY, 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, nullable = false)
public String getLastUpdateBy();
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = Element.DATETIME_PATTERN)
@ISProperty(name = LAST_UPDATE_TIME_PROPERTY, 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, nullable = false)
public Date getLastUpdateTime();
}

View File

@ -12,20 +12,21 @@ import org.gcube.informationsystem.utils.Version;
/**
* At any time entities and relations can be added or removed to/from a context or deleted.
* The PropagationConstraint property contained in each relation is a predefined Property type
* which indicates the behaviour to be held on a target entity when an event related to a context occurs
* in the source resource or directly to the relation.
* The PropagationConstraint property contained in each relation is a property
* which indicates the behaviour to be held on a target entity
* when an event related to a context occurs in the source resource
* or directly to the relation.
*
* The default values of propagation constraints are:
* - IsRelatedTo: remove=keep, add=unpropagate;
* - ConsistsOf : remove=cascadeWhenOrphan, add=propagate.
* - ConsistsOf : remove=cascade, add=propagate.
*
* https://wiki.gcube-system.org/gcube/Facet_Based_Resource_Model#Propagation_Constraint
*
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=PropagationConstraintImpl.class)
@TypeMetadata(name = PropagationConstraint.NAME, description = "This class provides propagation constraint for Relation", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = PropagationConstraint.NAME, description = "This type provides propagation constraint for Relation", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface PropagationConstraint extends Property {

View File

@ -25,7 +25,7 @@ import org.gcube.informationsystem.utils.Version;
*/
// @JsonIgnoreProperties(ignoreUnknown=true)
@JsonDeserialize(as=PropertyImpl.class)
@TypeMetadata(name = Property.NAME, description = "This is the base class for Properties", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Property.NAME, description = "This is the base type for any Property", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Property extends PropertyElement, SchemaMixedElement {

View File

@ -17,7 +17,7 @@ import org.gcube.informationsystem.utils.Version;
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=ConsistsOfImpl.class)
@TypeMetadata(name = ConsistsOf.NAME, description = "This is the base class for ConsistsOf relations", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = ConsistsOf.NAME, description = "This is the base type for any ConsistsOf relation", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface ConsistsOf<S extends Resource, T extends Facet>
extends Relation<S, T> {

View File

@ -16,7 +16,7 @@ import org.gcube.informationsystem.utils.Version;
*/
@Abstract
// @JsonDeserialize(as=IsRelatedToImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is the base class for IsRelatedTo relations", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = IsRelatedTo.NAME, description = "This is the base type for any IsRelatedTo relation", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface IsRelatedTo<S extends Resource, T extends Resource>
extends Relation<S, T> {

View File

@ -31,7 +31,7 @@ import org.gcube.informationsystem.utils.Version;
*/
@Abstract
// @JsonDeserialize(as=RelationImpl.class) Do not uncomment to manage subclasses
@TypeMetadata(name = Relation.NAME, description = "This is the base class for Relations", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = Relation.NAME, description = "This is the base type for any Relation", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface Relation<S extends Resource, T extends Entity> extends RelationElement<S,T>, SchemaMixedElement, ERElement {

View File

@ -104,9 +104,9 @@ public class TypeImpl implements Type {
return interfaceList;
}
protected Set<PropertyDefinition> retrieveListOfProperties(Class<?> type) {
protected Set<PropertyDefinition> retrieveListOfProperties(Class<?> clz) {
Set<PropertyDefinition> properties = new HashSet<>();
for (Method m : type.getDeclaredMethods()) {
for (Method m : clz.getDeclaredMethods()) {
m.setAccessible(true);
if (m.isAnnotationPresent(ISProperty.class)) {
if (m.isBridge()) {
@ -115,7 +115,7 @@ public class TypeImpl implements Type {
ISProperty propAnnotation = m.getAnnotation(ISProperty.class);
PropertyDefinition prop = new PropertyDefinitionImpl(propAnnotation, m);
properties.add(prop);
logger.trace("Property {} retrieved in type {} ", prop, type.getSimpleName());
logger.trace("Property {} retrieved in type {} ", prop, clz.getSimpleName());
}
}

View File

@ -16,7 +16,7 @@ import org.gcube.informationsystem.utils.Version;
* @author Luca Frosini (ISTI - CNR)
*/
@JsonDeserialize(as=LinkedEntityImpl.class)
@TypeMetadata(name = LinkedEntity.NAME, description = " A convenient type to define a Resource in terms of: mandatory/recommended ConsistsOf->Facets; uggested IsRelatedTo->Resource.", version = Version.MINIMAL_VERSION_STRING)
@TypeMetadata(name = LinkedEntity.NAME, description = " A convenient type to define a Resource in terms of: mandatory/recommended ConsistsOf->Facets; suggested IsRelatedTo->Resource.", version = Version.MINIMAL_VERSION_STRING)
@Change(version = Version.MINIMAL_VERSION_STRING, description = Version.MINIMAL_VERSION_DESCRIPTION)
public interface LinkedEntity extends PropertyElement {