40 lines
1.2 KiB
Java
40 lines
1.2 KiB
Java
package org.gcube.informationsystem.utils.documentation.model.entities;
|
|
|
|
import java.util.Set;
|
|
|
|
import org.gcube.informationsystem.base.reference.AccessType;
|
|
import org.gcube.informationsystem.types.reference.Type;
|
|
import org.gcube.informationsystem.types.reference.properties.LinkedEntity;
|
|
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
|
import org.gcube.informationsystem.utils.documentation.knowledge.FacetKnowledge;
|
|
import org.gcube.informationsystem.utils.documentation.rst.table.Table;
|
|
|
|
/**
|
|
* @author Luca Frosini (ISTI - CNR)
|
|
*/
|
|
public class FacetDocumentationGenerator extends EntityDocumentationGenerator {
|
|
|
|
public FacetDocumentationGenerator(Type type) {
|
|
super(type, AccessType.FACET);
|
|
}
|
|
|
|
@Override
|
|
protected Table getTable() {
|
|
Table table = new Table();
|
|
table.appendRow(getEntityHeadingRow());
|
|
Set<PropertyDefinition> properties = type.getProperties();
|
|
table = addPropertyRows(table, properties);
|
|
|
|
table.appendRow(getKnownUsageBoldRow());
|
|
table.appendRow(getSourceTargetBoldRow());
|
|
|
|
FacetKnowledge fk = FacetKnowledge.getInstace();
|
|
Set<LinkedEntity> usage = fk.getUsage(type.getName());
|
|
addLinkedEntities(table, usage);
|
|
|
|
return table;
|
|
}
|
|
|
|
|
|
}
|