All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.drools.compiler.DecisionTableFactory Maven / Gradle / Ivy

There is a newer version: 10.0.0
Show newest version
package org.drools.compiler;

import java.io.InputStream;

import org.drools.builder.DecisionTableConfiguration;
import org.drools.util.ServiceRegistryImpl;

public class DecisionTableFactory {
    private static DecisionTableProvider provider;
    

    
    public static String loadFromInputStream(InputStream is, DecisionTableConfiguration configuration) {

        return getDecisionTableProvider().loadFromInputStream( is, configuration );
    }
    
    public static synchronized void setDecisionTableProvider(DecisionTableProvider provider) {
        DecisionTableFactory.provider = provider;
    }
    
    public static synchronized DecisionTableProvider getDecisionTableProvider() {
        if ( provider == null ) {
            loadProvider();
        }
        return provider;
    }
    
    private static void loadProvider() {
        ServiceRegistryImpl.getInstance().addDefault( DecisionTableProvider.class,  "org.drools.decisiontable.DecisionTableProviderImpl" );
        setDecisionTableProvider(ServiceRegistryImpl.getInstance().get( DecisionTableProvider.class ) );
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy