Improved solution
This commit is contained in:
parent
b3cb92f55a
commit
6db5256e70
|
@ -0,0 +1,19 @@
|
|||
package org.gcube.informationsystem.types.knowledge;
|
||||
|
||||
import org.gcube.informationsystem.model.knowledge.ModelKnowledge;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
|
||||
/**
|
||||
* @author Luca Frosini (ISTI - CNR)
|
||||
*/
|
||||
public class TypesKnowledge {
|
||||
|
||||
protected static ModelKnowledge<Type, TypeInformation> modelKnowledge;
|
||||
|
||||
public synchronized static ModelKnowledge<Type, TypeInformation> getModelKnowledge() {
|
||||
if(modelKnowledge==null) {
|
||||
modelKnowledge = new ModelKnowledge<>(new TypeInformation());
|
||||
}
|
||||
return modelKnowledge;
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package org.gcube.informationsystem.model.knowledge;
|
||||
package org.gcube.informationsystem.types.knowledge;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
@ -10,12 +10,13 @@ import java.util.Map;
|
|||
import java.util.Map.Entry;
|
||||
|
||||
import org.gcube.informationsystem.base.reference.AccessType;
|
||||
import org.gcube.informationsystem.model.knowledge.ModelKnowledge;
|
||||
import org.gcube.informationsystem.model.knowledge.UsageKnowledge;
|
||||
import org.gcube.informationsystem.queries.templates.QueryTemplateTest;
|
||||
import org.gcube.informationsystem.tree.Node;
|
||||
import org.gcube.informationsystem.tree.NodeElaborator;
|
||||
import org.gcube.informationsystem.tree.Tree;
|
||||
import org.gcube.informationsystem.types.TypeMapper;
|
||||
import org.gcube.informationsystem.types.knowledge.TypeInformation;
|
||||
import org.gcube.informationsystem.types.reference.Type;
|
||||
import org.gcube.informationsystem.types.reference.properties.LinkedEntity;
|
||||
import org.gcube.informationsystem.types.reference.properties.PropertyDefinition;
|
||||
|
@ -44,7 +45,7 @@ public class ModelKnowledgeTest{
|
|||
|
||||
@Test
|
||||
public void test() throws Exception {
|
||||
ModelKnowledge<Type, TypeInformation> modelKnowledge = new ModelKnowledge<>(new TypeInformation());
|
||||
ModelKnowledge<Type, TypeInformation> modelKnowledge = TypesKnowledge.getModelKnowledge();
|
||||
|
||||
File typesDirectory = getTypesDirectory();
|
||||
|
Loading…
Reference in New Issue