Class ConverterGenerator
- java.lang.Object
-
- org.codehaus.plexus.logging.AbstractLogEnabled
-
- org.codehaus.modello.plugin.AbstractModelloGenerator
-
- org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
-
- org.codehaus.modello.plugin.converters.ConverterGenerator
-
- All Implemented Interfaces:
ModelloGenerator
,org.codehaus.plexus.logging.LogEnabled
,org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
public class ConverterGenerator extends AbstractJavaModelloGenerator
Generate a basic conversion class between two versions of a model.
-
-
Field Summary
-
Fields inherited from class org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
DEFAULT_DATE_FORMAT, domAsXpp3, useJava5
-
-
Constructor Summary
Constructors Constructor Description ConverterGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
generate(Model model, java.util.Properties parameters)
private void
generateConverters(Version toVersion)
private void
generateConverterTool(java.util.List<Version> allVersions)
private static java.lang.String
getSourceClassName(ModelClass modelClass, Version generatedVersion)
private static void
writeConvertMethod(JClass converterClass, Model objectModel, java.lang.String basePackage, java.util.List<Version> allVersions, Version v, ModelClass rootClass)
-
Methods inherited from class org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
addModelImport, addModelImports, getClasses, getDefaultValue, getJavaDefaultValue, getPrefix, getValueChecker, initHeader, initHeader, initialize, isJavaEnabled, isRelevant, isTrackingSupport, newJSourceWriter, suppressAllWarnings
-
Methods inherited from class org.codehaus.modello.plugin.AbstractModelloGenerator
capitalise, contextualize, getBuildContext, getEncoding, getFieldsForClass, getGeneratedVersion, getHeader, getModel, getOutputDirectory, getParameter, getParameter, getParameter, isClassInModel, isCollection, isEmpty, isInnerAssociation, isMap, isPackageWithVersion, singular, uncapitalise
-
-
-
-
Method Detail
-
generate
public void generate(Model model, java.util.Properties parameters) throws ModelloException
- Throws:
ModelloException
-
generateConverters
private void generateConverters(Version toVersion) throws ModelloException, java.io.IOException
- Throws:
ModelloException
java.io.IOException
-
generateConverterTool
private void generateConverterTool(java.util.List<Version> allVersions) throws ModelloException, java.io.IOException
- Throws:
ModelloException
java.io.IOException
-
writeConvertMethod
private static void writeConvertMethod(JClass converterClass, Model objectModel, java.lang.String basePackage, java.util.List<Version> allVersions, Version v, ModelClass rootClass)
-
getSourceClassName
private static java.lang.String getSourceClassName(ModelClass modelClass, Version generatedVersion)
-
-