public final Resource NamespaceMigrationStep_Prefix_to;
public final Resource NamespaceMigrationStep_Prefix_to_Inverse;
public final Resource Ontology;
+ public final Resource Ontology_defaultLocalName;
+ public final Resource Ontology_defaultLocalName_Inverse;
public final Resource Ontology_download;
public final Resource Ontology_download_Inverse;
public final Resource Ontology_global;
public final Resource SCLMigrationStep;
public final Resource SCLMigrationStep_SCLMigrationStepAction;
public final Resource SCLModule;
- public final Resource SCLModule_alias;
- public final Resource SCLModule_alias_Inverse;
public final Resource SCLModule_definition;
public final Resource SCLModule_definition_Inverse;
public final Resource SCLValue;
public static final String NamespaceMigrationStep_Prefix_to = "http://www.simantics.org/Layer0-1.1/NamespaceMigrationStep/Prefix/to";
public static final String NamespaceMigrationStep_Prefix_to_Inverse = "http://www.simantics.org/Layer0-1.1/NamespaceMigrationStep/Prefix/to/Inverse";
public static final String Ontology = "http://www.simantics.org/Layer0-1.1/Ontology";
+ public static final String Ontology_defaultLocalName = "http://www.simantics.org/Layer0-1.1/Ontology/defaultLocalName";
+ public static final String Ontology_defaultLocalName_Inverse = "http://www.simantics.org/Layer0-1.1/Ontology/defaultLocalName/Inverse";
public static final String Ontology_download = "http://www.simantics.org/Layer0-1.1/Ontology/download";
public static final String Ontology_download_Inverse = "http://www.simantics.org/Layer0-1.1/Ontology/download/Inverse";
public static final String Ontology_global = "http://www.simantics.org/Layer0-1.1/Ontology/global";
public static final String SCLMigrationStep = "http://www.simantics.org/Layer0-1.1/SCLMigrationStep";
public static final String SCLMigrationStep_SCLMigrationStepAction = "http://www.simantics.org/Layer0-1.1/SCLMigrationStep/SCLMigrationStepAction";
public static final String SCLModule = "http://www.simantics.org/Layer0-1.1/SCLModule";
- public static final String SCLModule_alias = "http://www.simantics.org/Layer0-1.1/SCLModule/alias";
- public static final String SCLModule_alias_Inverse = "http://www.simantics.org/Layer0-1.1/SCLModule/alias/Inverse";
public static final String SCLModule_definition = "http://www.simantics.org/Layer0-1.1/SCLModule/definition";
public static final String SCLModule_definition_Inverse = "http://www.simantics.org/Layer0-1.1/SCLModule/definition/Inverse";
public static final String SCLValue = "http://www.simantics.org/Layer0-1.1/SCLValue";
NamespaceMigrationStep_Prefix_to = getResourceOrNull(graph, URIs.NamespaceMigrationStep_Prefix_to);
NamespaceMigrationStep_Prefix_to_Inverse = getResourceOrNull(graph, URIs.NamespaceMigrationStep_Prefix_to_Inverse);
Ontology = getResourceOrNull(graph, URIs.Ontology);
+ Ontology_defaultLocalName = getResourceOrNull(graph, URIs.Ontology_defaultLocalName);
+ Ontology_defaultLocalName_Inverse = getResourceOrNull(graph, URIs.Ontology_defaultLocalName_Inverse);
Ontology_download = getResourceOrNull(graph, URIs.Ontology_download);
Ontology_download_Inverse = getResourceOrNull(graph, URIs.Ontology_download_Inverse);
Ontology_global = getResourceOrNull(graph, URIs.Ontology_global);
SCLMigrationStep = getResourceOrNull(graph, URIs.SCLMigrationStep);
SCLMigrationStep_SCLMigrationStepAction = getResourceOrNull(graph, URIs.SCLMigrationStep_SCLMigrationStepAction);
SCLModule = getResourceOrNull(graph, URIs.SCLModule);
- SCLModule_alias = getResourceOrNull(graph, URIs.SCLModule_alias);
- SCLModule_alias_Inverse = getResourceOrNull(graph, URIs.SCLModule_alias_Inverse);
SCLModule_definition = getResourceOrNull(graph, URIs.SCLModule_definition);
SCLModule_definition_Inverse = getResourceOrNull(graph, URIs.SCLModule_definition_Inverse);
SCLValue = getResourceOrNull(graph, URIs.SCLValue);
private static final TCon RESOURCE = Types.con(DB_MODULE, "Resource");
Resource ontology;
+ String defaultLocalName;
THashMap<Resource,Map<String,Resource>> childMaps = new THashMap<Resource,Map<String,Resource>>();
public OntologyModule(ReadGraph graph, String moduleName) throws DatabaseException {
super(moduleName);
ontology = graph.getResource(moduleName);
+ readDefaultLocalName(graph);
childMaps.put(ontology, createLocalMap(graph, ontology));
}
+
+ private void readDefaultLocalName(ReadGraph graph) throws DatabaseException {
+ Layer0 L0 = Layer0.getInstance(graph);
+ defaultLocalName = graph.getPossibleRelatedValue(ontology, L0.Ontology_defaultLocalName);
+ if(defaultLocalName == null)
+ defaultLocalName = "";
+ }
+
+ @Override
+ public String getDefaultLocalName() {
+ return defaultLocalName;
+ }
@Override
public List<ImportDeclaration> getDependencies() {
public class ModuleHeader {
public String classLoader;
public long classLoaderLocation;
+ public String defaultLocalName;
private void read(ErrorLog errorLog, DModuleHeader header) {
for(FieldAssignment assignment : header.fields)
classLoaderLocation = assignment.location;
}
break;
+ case "defaultLocalName":
+ if(assignment.value == null)
+ errorLog.log(assignment.location, "Property defaultLocalName needs to be given a string value.");
+ else {
+ defaultLocalName = AnnotationUtils.extractString(assignment.value);
+ if(defaultLocalName == null)
+ errorLog.log(assignment.value.location, "Expected string here.");
+ }
+ break;
default:
errorLog.logWarning(assignment.location, "Unknown module header field was skipped.");
}
public class ConcreteModule implements Module {
String moduleName;
+ String defaultLocalName;
THashMap<String, TypeDescriptor> typeDescriptors = new THashMap<String, TypeDescriptor>();
THashMap<String, EffectConstructor> effectConstructors = new THashMap<String, EffectConstructor>();
THashMap<String, TypeClass> typeClasses = new THashMap<String, TypeClass>();
this.moduleName = moduleName;
}
+ @Override
+ public String getDefaultLocalName() {
+ return defaultLocalName;
+ }
+
+ public void setDefaultLocalName(String defaultLocalName) {
+ this.defaultLocalName = defaultLocalName;
+ }
+
public boolean addTypeDescriptor(String name, TypeDescriptor typeConstructor) {
return typeDescriptors.put(name, typeConstructor) != null;
}