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

org.abstractmeta.code.g.CodeGenerator Maven / Gradle / Ivy

The newest version!
/**
 * Copyright 2011 Adrian Witas
 *
 * 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 org.abstractmeta.code.g;


import org.abstractmeta.code.g.config.Descriptor;
import org.abstractmeta.code.g.handler.CodeHandler;


/**
 * Represents a code builder.
 * 

This abstraction is responsible for building code. * It uses code generation plugins to generate specialised code. *

*

Usage: *

 *     CodeGenerator codeGenerator = new CodeBuilderImpl();
 *     DescriptorFactory descriptorFactory = new DescriptorFactory();
 *     Collection<Descriptor> descriptors = Arrays.asList(
 *         ...
 *     );
 *     PersistenceHandler persistenceHandler = new PersistenceHandler(new File("target/generated/code-r/"));
 *     codeGenerator.generate(descriptors, persistenceHandler);
 *     List generated = persistenceHandler.getGeneratedFiles();
 *
 * 
*

*

*/ public interface CodeGenerator { /** * Builds code for the specified descriptors. * * @param descriptors descriptors * @param handler code handler * @param classLoader class loader */ void generate(Iterable descriptors, CodeHandler handler, ClassLoader classLoader); /** * Builds code for the specified descriptors. * * @param descriptors descriptors * @param handler code handler */ void generate(Iterable descriptors, CodeHandler handler); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy