Class DMNCompilerImpl

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

    public class DMNCompilerImpl
    extends java.lang.Object
    implements org.kie.dmn.api.core.DMNCompiler
    • Constructor Summary

      Constructors 
      Constructor Description
      DMNCompilerImpl()  
      DMNCompilerImpl​(org.kie.dmn.api.core.DMNCompilerConfiguration dmnCompilerConfig)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCallback​(DMNCompilerImpl.AfterProcessDrgElements callback)  
      org.kie.dmn.api.core.DMNModel compile​(java.io.Reader source, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels)  
      org.kie.dmn.api.core.DMNModel compile​(java.io.Reader source, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels, org.kie.api.io.Resource resource)  
      org.kie.dmn.api.core.DMNModel compile​(org.kie.api.io.Resource resource, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels)  
      org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels)  
      org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels, org.kie.api.io.Resource resource, java.util.function.Function<java.lang.String,​java.io.Reader> relativeResolver)  
      org.kie.dmn.api.core.DMNModel compile​(org.kie.dmn.model.api.Definitions dmndefs, org.kie.api.io.Resource resource, java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels)  
      org.kie.dmn.api.core.DMNCompilerConfiguration getDmnCompilerConfig()  
      DMNDecisionLogicCompiler getEvaluatorCompiler()  
      static java.lang.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.
      org.kie.dmn.api.marshalling.DMNMarshaller getMarshaller()  
      static javax.xml.namespace.QName getNamespaceAndName​(org.kie.dmn.model.api.DMNModelInstrumentedBase localElement, java.util.Map<java.lang.String,​javax.xml.namespace.QName> importAliases, javax.xml.namespace.QName typeRef, java.lang.String modelNamespace)
      Given a typeRef in the form of prefix:localname or importalias.localname, resolves namespace and localname appropriately.
      java.util.List<org.kie.dmn.api.marshalling.DMNExtensionRegister> getRegisteredExtensions()  
      void linkRequirements​(DMNModelImpl model, DMNBaseNode node)  
      protected static org.kie.api.io.Resource pmmlImportResource​(java.lang.ClassLoader classLoader, DMNModelImpl model, org.kie.dmn.model.api.Import i, org.kie.dmn.model.api.DMNModelInstrumentedBase node)  
      protected static org.kie.api.io.Resource resolveRelativeResource​(java.lang.ClassLoader classLoader, DMNModelImpl model, org.kie.dmn.model.api.Import i, org.kie.dmn.model.api.DMNModelInstrumentedBase node, java.util.function.Function<java.lang.String,​java.io.Reader> relativeResolver)  
      protected static java.net.URI resolveRelativeURI​(DMNModelImpl model, java.lang.String relative)  
      org.kie.dmn.api.core.DMNType resolveTypeRef​(DMNModelImpl dmnModel, org.kie.dmn.model.api.NamedElement model, org.kie.dmn.model.api.DMNModelInstrumentedBase localElement, javax.xml.namespace.QName typeRef)
      Resolve the QName typeRef accordingly to definition of builtin (FEEL) types, local model ItemDef or imported definitions.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.kie.dmn.api.core.DMNCompiler

        compile, compile, compile
    • 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,
                                                     java.util.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​(java.io.Reader source,
                                                     java.util.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​(java.io.Reader source,
                                                     java.util.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,
                                                     java.util.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,
                                                     java.util.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,
                                                     java.util.Collection<org.kie.dmn.api.core.DMNModel> dmnModels,
                                                     org.kie.api.io.Resource resource,
                                                     java.util.function.Function<java.lang.String,​java.io.Reader> relativeResolver)
      • resolveRelativeResource

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

        protected static org.kie.api.io.Resource pmmlImportResource​(java.lang.ClassLoader classLoader,
                                                                    DMNModelImpl model,
                                                                    org.kie.dmn.model.api.Import i,
                                                                    org.kie.dmn.model.api.DMNModelInstrumentedBase node)
      • resolveRelativeURI

        protected static java.net.URI resolveRelativeURI​(DMNModelImpl model,
                                                         java.lang.String relative)
                                                  throws java.net.URISyntaxException,
                                                         java.io.IOException
        Throws:
        java.net.URISyntaxException
        java.io.IOException
      • getId

        public static java.lang.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,
                                                           javax.xml.namespace.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 javax.xml.namespace.QName getNamespaceAndName​(org.kie.dmn.model.api.DMNModelInstrumentedBase localElement,
                                                                    java.util.Map<java.lang.String,​javax.xml.namespace.QName> importAliases,
                                                                    javax.xml.namespace.QName typeRef,
                                                                    java.lang.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 java.util.List<org.kie.dmn.api.marshalling.DMNExtensionRegister> getRegisteredExtensions()