use of org.finos.legend.pure.generated.Root_meta_pure_model_unit_ModelUnit in project legend-engine by finos.
the class BindingCompiler method secondPass.
// Second pass - resolve schemas and model elements
private void secondPass(Binding srcBinding, CompileContext context) {
String path = context.pureModel.buildPackageString(srcBinding._package, srcBinding.name);
Root_meta_external_shared_format_binding_Binding compiled = bindingIndex.get(path);
compiled._contentType(srcBinding.contentType);
if (srcBinding.schemaSet != null) {
Root_meta_external_shared_format_metamodel_SchemaSet schemaSet = HelperExternalFormat.getSchemaSet(srcBinding.schemaSet, srcBinding.sourceInformation, context);
if (srcBinding.schemaId != null && schemaSet._schemas().noneSatisfy(s -> srcBinding.schemaId.equals(s._id()))) {
throw new EngineException("ID '" + srcBinding.schemaId + "' does not exist in SchemaSet '" + srcBinding.schemaSet + "'", srcBinding.sourceInformation, EngineErrorType.COMPILATION);
}
compiled._schemaSet(schemaSet)._schemaId(srcBinding.schemaId);
}
Root_meta_pure_model_unit_ModelUnit modelUnit = new Root_meta_pure_model_unit_ModelUnit_Impl("")._classifierGenericType(new Root_meta_pure_metamodel_type_generics_GenericType_Impl("")._rawType(context.pureModel.getType("meta::pure::model::unit::ModelUnit")))._packageableElementIncludes(ListIterate.collect(srcBinding.modelUnit.packageableElementIncludes, pe -> context.pureModel.getPackageableElement(pe, srcBinding.sourceInformation)))._packageableElementExcludes(ListIterate.collect(srcBinding.modelUnit.packageableElementExcludes, pe -> context.pureModel.getPackageableElement(pe, srcBinding.sourceInformation)));
compiled._modelUnit(modelUnit);
}
Aggregations