org.codehaus.modello.plugin

Class AbstractModelloGenerator

Implemented Interfaces:
ModelloGenerator
Known Direct Subclasses:
AbstractJDOMGenerator, AbstractStaxGenerator, AbstractVelocityModelloGenerator, AbstractXmlGenerator, AbstractXpp3Generator, ConverterGenerator, Dom4jReaderGenerator, Dom4jWriterGenerator, JavaModelloGenerator, JPoxJdoMappingModelloGenerator, StoreModelloGenerator

public abstract class AbstractModelloGenerator
extends AbstractLogEnabled
implements ModelloGenerator

Version:
$Id: AbstractModelloGenerator.java 895 2008-05-24 22:31:50Z hboutemy $
Authors:
Jason van Zyl
Emmanuel Venisse

Method Summary

protected void
addModelImports(JClass jClass, BaseElement baseElem)
protected String
capitalise(String str)
protected String
getEncoding()
protected List
getFieldsForClass(ModelClass modelClass)
Return the child fields of this class.
protected Version
getGeneratedVersion()
protected Model
getModel()
File
getOutputDirectory()
protected String
getParameter(Properties parameters, String name)
protected String
getParameter(Properties parameters, String name, String defaultValue)
protected String
getParameter(String name, Properties parameters)
protected String
getPrefix(JavaFieldMetadata javaFieldMetadata)
protected void
initialize(Model model, Properties parameters)
protected boolean
isClassInModel(String fieldType, Model model)
protected boolean
isCollection(String fieldType)
protected boolean
isEmpty(String string)
protected boolean
isInnerAssociation(ModelField field)
protected boolean
isMap(String fieldType)
protected boolean
isPackageWithVersion()
protected JSourceWriter
newJSourceWriter(String packageName, String className)
Create a new java source file writer, with configured encoding.
protected String
singular(String name)
static String
uncapitalise(String str)

Method Details

addModelImports

protected void addModelImports(JClass jClass,
                               BaseElement baseElem)
            throws ModelloException

capitalise

protected String capitalise(String str)

getEncoding

protected String getEncoding()

getFieldsForClass

protected List getFieldsForClass(ModelClass modelClass)
Return the child fields of this class.
Parameters:
modelClass - current class
Returns:
the list of fields of this class

getGeneratedVersion

protected Version getGeneratedVersion()

getModel

protected Model getModel()

getOutputDirectory

public File getOutputDirectory()

getParameter

protected String getParameter(Properties parameters,
                              String name)

getParameter

protected String getParameter(Properties parameters,
                              String name,
                              String defaultValue)

getParameter

protected String getParameter(String name,
                              Properties parameters)

Deprecated.


getPrefix

protected String getPrefix(JavaFieldMetadata javaFieldMetadata)

initialize

protected void initialize(Model model,
                          Properties parameters)
            throws ModelloException

isClassInModel

protected boolean isClassInModel(String fieldType,
                                 Model model)

isCollection

protected boolean isCollection(String fieldType)

isEmpty

protected boolean isEmpty(String string)

isInnerAssociation

protected boolean isInnerAssociation(ModelField field)

isMap

protected boolean isMap(String fieldType)

isPackageWithVersion

protected boolean isPackageWithVersion()

newJSourceWriter

protected JSourceWriter newJSourceWriter(String packageName,
                                         String className)
            throws IOException
Create a new java source file writer, with configured encoding.
Parameters:
packageName - the package of the source file to create
className - the class of the source file to create
Returns:
a JSourceWriter with configured encoding

singular

protected String singular(String name)

uncapitalise

public static String uncapitalise(String str)