Class DMNCompilerImpl

  • All Implemented Interfaces:
    org.kie.dmn.api.core.DMNCompiler

    public class DMNCompilerImpl
    extends Object
    implements org.kie.dmn.api.core.DMNCompiler
    • Constructor Detail

      • DMNCompilerImpl

        public DMNCompilerImpl()
      • DMNCompilerImpl

        public DMNCompilerImpl​(org.kie.dmn.api.core.DMNCompilerConfiguration dmnCompilerConfig)
    • Method Detail

      • compile

        public org.kie.dmn.api.core.DMNModel compile​(org.kie.api.io.Resource resource,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels)
        Specified by:
        compile in interface org.kie.dmn.api.core.DMNCompiler
      • compile

        public org.kie.dmn.api.core.DMNModel compile​(Reader source,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels)
        Specified by:
        compile in interface org.kie.dmn.api.core.DMNCompiler
      • compile

        public org.kie.dmn.api.core.DMNModel compile​(Reader source,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels,
                                                     org.kie.api.io.Resource resource)
      • getMarshaller

        public org.kie.dmn.api.marshalling.DMNMarshaller getMarshaller()
      • compile

        public org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels)
        Specified by:
        compile in interface org.kie.dmn.api.core.DMNCompiler
      • compile

        public org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs,
                                                     org.kie.api.io.Resource resource,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels)
        Specified by:
        compile in interface org.kie.dmn.api.core.DMNCompiler
      • compile

        public org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs,
                                                     Collection<org.kie.dmn.api.core.DMNModel> dmnModels,
                                                     org.kie.api.io.Resource resource,
                                                     Function<String,​Reader> relativeResolver)
      • resolveRelativeResource

        protected static org.kie.api.io.Resource resolveRelativeResource​(ClassLoader classLoader,
                                                                         DMNModelImpl model,
                                                                         org.kie.dmn.model.api.Import i,
                                                                         org.kie.dmn.model.api.DMNModelInstrumentedBase node,
                                                                         Function<String,​Reader> relativeResolver)
      • pmmlImportURL

        protected static URL pmmlImportURL​(ClassLoader classLoader,
                                           DMNModelImpl model,
                                           org.kie.dmn.model.api.Import i,
                                           org.kie.dmn.model.api.DMNModelInstrumentedBase node)
      • getId

        public static String getId​(org.kie.dmn.model.api.DMNElementReference er)
        For the purpose of Compilation, in the DMNModel the DRGElements are stored with their full ID, so an ElementReference might reference in two forms: - #id (a local to the model ID) - namespace#id (an imported DRGElement ID) This method now returns in the first case the proper ID, while leave unchanged in the latter case, in order for the ID to be reconciliable on the DMNModel.
      • resolveTypeRef

        public org.kie.dmn.api.core.DMNType resolveTypeRef​(DMNModelImpl dmnModel,
                                                           org.kie.dmn.model.api.NamedElement model,
                                                           org.kie.dmn.model.api.DMNModelInstrumentedBase localElement,
                                                           QName typeRef)
        Resolve the QName typeRef accordingly to definition of builtin (FEEL) types, local model ItemDef or imported definitions. If the typeRef cannot be resolved, (FEEL) UNKNOWN is returned and an error logged using standard DMN message logging.
      • getNamespaceAndName

        public static QName getNamespaceAndName​(org.kie.dmn.model.api.DMNModelInstrumentedBase localElement,
                                                Map<String,​QName> importAliases,
                                                QName typeRef,
                                                String modelNamespace)
        Given a typeRef in the form of prefix:localname or importalias.localname, resolves namespace and localname appropriately.
        Example: feel:string would be resolved as http://www.omg.org/spec/FEEL/20140401, string.
        Example: myimport.tPerson assuming an external model namespace as "http://drools.org" would be resolved as http://drools.org, tPerson.
        Parameters:
        localElement - the local element is used to determine the namespace from the prefix if present, as in the form prefix:localname
        importAliases - the map of import aliases is used to determine the namespace, as in the form importalias.localname
        typeRef - the typeRef to be resolved.
        Returns:
      • getDmnCompilerConfig

        public org.kie.dmn.api.core.DMNCompilerConfiguration getDmnCompilerConfig()
      • getRegisteredExtensions

        public List<org.kie.dmn.api.marshalling.DMNExtensionRegister> getRegisteredExtensions()