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

org.kie.kogito.codegen.Generator Maven / Gradle / Ivy

There is a newer version: 1.2.0.Final
Show newest version
/*
 * Copyright 2019 Red Hat, Inc. and/or its affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.kie.kogito.codegen;

import java.nio.file.Path;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;

import org.drools.modelcompiler.builder.GeneratedFile;
import org.kie.kogito.codegen.di.DependencyInjectionAnnotator;

/**
 * A code generator for a part of the platform, e.g. rules, processes, etc.
 */
public interface Generator {

    /**
     * Returns the "section" of the Application class corresponding to rules.
     * e.g the processes() method with processes().createMyProcess() etc.
     *
     */
    ApplicationSection section();

    /**
     * Returns the collection of all the files that have been generated/compiled
     *
     */
    Collection generate();

    /**
     * Consumes the given ConfigGenerator so that it can enrich it with
     * further, Generator-specific details.
     *
     * This is automatically called by the ApplicationGenerator.
     */
    void updateConfig(ConfigGenerator cfg);

    void setPackageName(String packageName);

    void setDependencyInjection(DependencyInjectionAnnotator annotator);
    
    void setProjectDirectory(Path projectDirectory);
    
    void setContext(GeneratorContext context);
    
    GeneratorContext context();
    
    default Map getLabels() {
        return Collections.emptyMap();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy