diff --git a/src/main/java/org/gcube/informationsystem/utils/documentation/generator/Generator.java b/src/main/java/org/gcube/informationsystem/utils/documentation/generator/Generator.java index ee5f6f9..2b51fc4 100644 --- a/src/main/java/org/gcube/informationsystem/utils/documentation/generator/Generator.java +++ b/src/main/java/org/gcube/informationsystem/utils/documentation/generator/Generator.java @@ -37,7 +37,7 @@ public class Generator { return modelKnowledge; } - public Class getDocumentationGeneratorClass(AccessType accessType) + public Class getDocumentationClass(AccessType accessType) throws Exception { Class clz; switch (accessType) { @@ -75,52 +75,52 @@ public class Generator { return clz; } - protected Documentation getDocumentationGenerator(Type type) throws Exception { - Documentation dg = null; + protected Documentation getDocumentation(Type type) throws Exception { + Documentation d = null; switch (type.getAccessType()) { case PROPERTY: - dg = new PropertyDocumentation(type); - dg.setLevel(0); + d = new PropertyDocumentation(type); + d.setLevel(0); break; case ENTITY: - dg = new EntityDocumentation(type); - dg.setLevel(0); + d = new EntityDocumentation(type); + d.setLevel(0); break; case RESOURCE: - dg = new ResourceDocumentation(type); - dg.setLevel(1); + d = new ResourceDocumentation(type); + d.setLevel(1); break; case FACET: - dg = new FacetDocumentation(type); - dg.setLevel(1); + d = new FacetDocumentation(type); + d.setLevel(1); break; case RELATION: - dg = new RelationDocumentation(type); - dg.setLevel(0); + d = new RelationDocumentation(type); + d.setLevel(0); break; case IS_RELATED_TO: - dg = new IsRelatedToDocumentation(type); - dg.setLevel(1); + d = new IsRelatedToDocumentation(type); + d.setLevel(1); break; case CONSISTS_OF: - dg = new ConsistsOfDocumentation(type); - dg.setLevel(1); + d = new ConsistsOfDocumentation(type); + d.setLevel(1); break; default: throw new Exception("I'm not developed to manage the " + AccessType.class.getSimpleName() + " " + type.getName()); } UsageKnowledge facetKnowledge = modelKnowledge.getUsageKnowledge(AccessType.FACET); - dg.setFacetKnowledge(facetKnowledge); + d.setFacetKnowledge(facetKnowledge); UsageKnowledge resourceKnowledge = modelKnowledge.getUsageKnowledge(AccessType.RESOURCE); - dg.setResourceKnowledge(resourceKnowledge); - return dg; + d.setResourceKnowledge(resourceKnowledge); + return d; } protected File getFile(String fileName, boolean newFile) throws IOException { @@ -139,7 +139,7 @@ public class Generator { } protected void writeSectionOnly(Type type, File file, Integer level) throws Exception { - Documentation dg = getDocumentationGenerator(type); + Documentation dg = getDocumentation(type); if(level!=null) { dg.setLevel(level); } @@ -148,7 +148,7 @@ public class Generator { } protected void writeTypeToFile(Type type, File file, Integer level) throws Exception { - Documentation dg = getDocumentationGenerator(type); + Documentation dg = getDocumentation(type); if(level!=null) { dg.setLevel(level); }