information-system-model-do.../src/main/java/org/gcube/informationsystem/utils/documentation/model/relations/RelationDocumentationGenera...

47 lines
1.4 KiB
Java

package org.gcube.informationsystem.utils.documentation.model.relations;
import org.gcube.informationsystem.base.reference.relations.RelationElement;
import org.gcube.informationsystem.types.TypeMapper;
import org.gcube.informationsystem.types.reference.Type;
import org.gcube.informationsystem.utils.documentation.model.DocumentationGenerator;
import org.gcube.informationsystem.utils.documentation.rst.table.Cell;
import org.gcube.informationsystem.utils.documentation.rst.table.Row;
import org.gcube.informationsystem.utils.documentation.rst.table.RowType;
import org.gcube.informationsystem.utils.documentation.rst.table.Table;
/**
* @author Luca Frosini (ISTI - CNR)
*/
public class RelationDocumentationGenerator extends DocumentationGenerator {
public RelationDocumentationGenerator(Type type) {
super(type, TypeMapper.getType(RelationElement.class));
}
protected Row getHeadingRow() {
Row row = new Row(RowType.HEADING);
Cell name = new Cell();
name.setText("Name");
row.appendCell(name);
Cell type = new Cell();
type.setText("Type");
row.appendCell(type);
Cell attributes = new Cell();
attributes.setText("Attributes");
row.appendCell(attributes);
Cell description = new Cell();
description.setText("Description");
row.appendCell(description);
return row;
}
@Override
protected Table getTable() {
Table table = new Table();
table.appendRow(getHeadingRow());
return table;
}
}