Renamed enum
This commit is contained in:
parent
29f91f7410
commit
38e264bb59
|
@ -67,7 +67,7 @@ public class DocGenerator {
|
|||
generate(pkgs.toArray(new Package[pkgs.size()]));
|
||||
}
|
||||
|
||||
protected File getFile(ClassesMapping cm) throws IOException {
|
||||
protected File getFile(ModelTypes cm) throws IOException {
|
||||
String fileName = cm.getFilename();
|
||||
File file = new File(fileName);
|
||||
|
||||
|
@ -89,7 +89,7 @@ public class DocGenerator {
|
|||
return file;
|
||||
}
|
||||
|
||||
protected <E extends Element> void generateAllOfType(ClassesMapping cm, Package[] packages) throws Exception {
|
||||
protected <E extends Element> void generateAllOfType(ModelTypes cm, Package[] packages) throws Exception {
|
||||
ElementSpecilizationDiscovery<E> discovery = new ElementSpecilizationDiscovery<>(cm.getAccessType().getTypeClass());
|
||||
if(Objects.nonNull(packages)) {
|
||||
Arrays.stream(packages).forEach(p -> discovery.addPackage(p));
|
||||
|
@ -105,7 +105,7 @@ public class DocGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
protected void generateSingle(ClassesMapping cm) throws Exception {
|
||||
protected void generateSingle(ModelTypes cm) throws Exception {
|
||||
File f = getFile(cm);
|
||||
DocumentationGenerator dgInstance = cm.getDocumentationGeneratorInstance(cm.getAccessType().getTypeClass());
|
||||
StringBuffer sb = dgInstance.generateSection();
|
||||
|
@ -113,7 +113,7 @@ public class DocGenerator {
|
|||
}
|
||||
|
||||
protected void generate(Package[] packages) throws Exception {
|
||||
for(ClassesMapping cm : ClassesMapping.values()) {
|
||||
for(ModelTypes cm : ModelTypes.values()) {
|
||||
if(cm.discover()) {
|
||||
generateAllOfType(cm, packages);
|
||||
}else {
|
||||
|
|
|
@ -15,15 +15,15 @@ import org.gcube.informationsystem.utils.documentation.model.relations.RelationD
|
|||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public enum ClassesMapping {
|
||||
public enum ModelTypes {
|
||||
|
||||
PROPERTY(AccessType.PROPERTY, PropertyDocumentationGenerator.class, true, ClassesMapping.PROPERTIES_FILENAME, true),
|
||||
ENTITY(AccessType.ENTITY, EntityDocumentationGenerator.class, false, ClassesMapping.ENTITIES_FILENAME, true),
|
||||
RESOURCE(AccessType.RESOURCE, ResourceDocumentationGenerator.class, true, ClassesMapping.ENTITIES_FILENAME, false),
|
||||
FACET(AccessType.FACET, FacetDocumentationGenerator.class, true, ClassesMapping.ENTITIES_FILENAME, false),
|
||||
RELATION(AccessType.RELATION, RelationDocumentationGenerator.class, false, ClassesMapping.RELATIONS_FILENAME, true),
|
||||
IS_RELATED_TO(AccessType.IS_RELATED_TO, IsRelatedToDocumentationGenerator.class, true, ClassesMapping.RELATIONS_FILENAME, false),
|
||||
CONSISTS_OF(AccessType.CONSISTS_OF, ConsistsOfDocumentationGenerator.class, true, ClassesMapping.RELATIONS_FILENAME, false);
|
||||
PROPERTY(AccessType.PROPERTY, PropertyDocumentationGenerator.class, true, ModelTypes.PROPERTIES_FILENAME, true),
|
||||
ENTITY(AccessType.ENTITY, EntityDocumentationGenerator.class, false, ModelTypes.ENTITIES_FILENAME, true),
|
||||
RESOURCE(AccessType.RESOURCE, ResourceDocumentationGenerator.class, true, ModelTypes.ENTITIES_FILENAME, false),
|
||||
FACET(AccessType.FACET, FacetDocumentationGenerator.class, true, ModelTypes.ENTITIES_FILENAME, false),
|
||||
RELATION(AccessType.RELATION, RelationDocumentationGenerator.class, false, ModelTypes.RELATIONS_FILENAME, true),
|
||||
IS_RELATED_TO(AccessType.IS_RELATED_TO, IsRelatedToDocumentationGenerator.class, true, ModelTypes.RELATIONS_FILENAME, false),
|
||||
CONSISTS_OF(AccessType.CONSISTS_OF, ConsistsOfDocumentationGenerator.class, true, ModelTypes.RELATIONS_FILENAME, false);
|
||||
|
||||
public static final String PROPERTIES_FILENAME = "properties.rst";
|
||||
public static final String ENTITIES_FILENAME = "entities.rst";
|
||||
|
@ -35,7 +35,7 @@ public enum ClassesMapping {
|
|||
private final String filename;
|
||||
private final boolean newFile;
|
||||
|
||||
ClassesMapping(AccessType accessType, Class<? extends DocumentationGenerator> dgClz, boolean discover, String filename, boolean newFile) {
|
||||
ModelTypes(AccessType accessType, Class<? extends DocumentationGenerator> dgClz, boolean discover, String filename, boolean newFile) {
|
||||
this.accessType = accessType;
|
||||
this.dgClz = dgClz;
|
||||
this.discover = discover;
|
Loading…
Reference in New Issue