<commit_before>/**
 *
 * Copyright (c) 2006-2018, Speedment, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * 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 com.speedment.common.codegen;

import java.util.Collection;
import java.util.Optional;
import java.util.stream.Stream;

/**
 * A hook to the generator that can be passed to various stages in the pipeline.
 * Contains multiple methods for generating model-to-model or model-to-text.
 * 
 * @author  <NAME>
 * @since   2.0
 */
public interface Generator {

    /**
     * Returns the {@link DependencyManager} currently being used.
     * 
     * @return  the dependency manager
     * 
     * @see DependencyManager
     */
    DependencyManager getDependencyMgr();

    /**
     * Returns the current rendering stack. The top element will be the one most
     * recent rendered and the bottom one will be the element that was first
     * passed to the generator. Elements are removed from the stack once they
     * have finished rendering.
     * <p>
     * If an element needs to access its parent, it can call this method and
     * peek on the second element from the top.
     *<commit_msg>CodeGen: Fix #675 add static constructor for JavaGenerator<commit_after>/**
 *
 * Copyright (c) 2006-2018, Speedment, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); You may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at:
 *
 * 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 com.speedment.common.codegen;

import com.speedment.common.codegen.internal.java.JavaGenerator;

import java.util.Collection;
import java.util.Optional;
import java.util.stream.Stream;

/**
 * A hook to the generator that can be passed to various stages in the pipeline.
 * Contains multiple methods for generating model-to-model or model-to-text.
 * 
 * @author  <NAME>
 * @since   2.0
 */
public interface Generator {

    /**
     * Returns an implementation of this interface that uses the default
     * implementation used to generate Java code.
     *
     * @return  the default generator for Java
     */
    static Generator forJava() {
        return new JavaGenerator();
    }

    /**
     * Returns the {@link DependencyManager} currently being used.
     * 
     * @return  the dependency manager
     * 
     * @see DependencyManager
     */
    DependencyManager getDependencyMgr();

    /**
     * Returns the current rendering stack. The top element will be the one most
     * recent rendered and the bottom one will be the element that was first
     * passed to the generator. Elements are removed from the stack once they
     * have finished rendering.
     * <p>
     * If an element needs to access its parent, it can call this method and
     * peek on the second element from the top.
     *
{'fraction_non_alphanumeric': 0.07635869565217392, 'fraction_numerical': 0.00842391304347826, 'mean_word_length': 3.0764119601328903, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6964014', 'n_tokens_mistral': 970, 'n_tokens_neox': 933, 'n_words': 445}