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

org.openxma.dsl.generator.NamingStrategy Maven / Gradle / Ivy

package org.openxma.dsl.generator;

import org.openxma.dsl.core.model.ModelElement;
import org.openxma.dsl.dom.model.Attribute;
import org.openxma.dsl.dom.model.Dao;
import org.openxma.dsl.dom.model.Entity;

/**
 * Strategy interface for determining various names, like column and table
 * names, given the respective model elements. This interface is used from the
 * default workflow and templates during a generator run.
 * 
 * Implementations use this to implement project-scoped naming standards.
 */
public interface NamingStrategy {
	/**
	 * Return a table name for an {@code Dao}
	 * 
	 * @param dao
	 *            the dao instance to generate the table name for
	 * @return a table name for the given dao
	 */
	String getTableName(Dao dao);

	/**
	 * Return the alias name for an {@code Dao}.
	 * 
	 * @param dao the dao instance to generate the table alias for
	 * @return an alias name for the given dao
	 */
	String getQualifier(Dao dao);

	/**
	 * Return the column name for an Attribute.
	 * 
	 * @param entity the entity of the given attribute 
	 * @param feature the feature to calculate the column for
	 * @return a column name for the given feature
	 */
	String getColumnName(Entity entity, Attribute feature);

	/**
	 * Return the column name for a nested (embeddable) Attribute.
	 * 
	 * @param entity the entity of the given attribute 
	 * @param feature the feature to calculate the column for
	 * @param nestedfeature
	 * @return a column name for the given nested feature
	 */
	String getColumnName(Entity entity, Attribute feature, Attribute nestedfeature);

	/**
	 * Return the implementation package name for the given modeElement.
	 * 
	 * @param modeElement
	 *            the modeElement instance to calculate the package for
	 * @return the implementation package name for the given modeElement
	 */
	String getPackageName(ModelElement modeElement);

	/**
	 * Return the interface package name for the given modeElement.
	 * 
	 * @param modeElement
	 *            the modeElement instance to calculate the package for
	 * @return the interface package name for the given modeElement
	 */
	String getInterfacePackageName(ModelElement modeElement);
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy