org.codehaus.modello.plugins.xml

Class AbstractXmlGenerator

Implemented Interfaces:
ModelloGenerator
Known Direct Subclasses:
XdocGenerator, XsdGenerator

public abstract class AbstractXmlGenerator
extends AbstractModelloGenerator

Version:
$Id: AbstractXmlGenerator.java 914 2008-07-28 07:29:56Z olamy $
Author:
Hervé Boutemy

Method Summary

protected List
getAttributeFieldsForClass(ModelClass modelClass)
Return the child attribute fields of this class.
protected ModelField
getContentField(List modelFields)
protected boolean
hasContentField(List modelFields)
protected String
resolveFieldTagName(ModelField field)
Compute the tagName of a given field.

Methods inherited from class org.codehaus.modello.plugin.AbstractModelloGenerator

addModelImports, capitalise, getEncoding, getFieldsForClass, getGeneratedVersion, getModel, getOutputDirectory, getParameter, getParameter, getParameter, getPrefix, initialize, isClassInModel, isCollection, isEmpty, isInnerAssociation, isMap, isPackageWithVersion, newJSourceWriter, singular, uncapitalise

Method Details

getAttributeFieldsForClass

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

getContentField

protected ModelField getContentField(List modelFields)

hasContentField

protected boolean hasContentField(List modelFields)

resolveFieldTagName

protected String resolveFieldTagName(ModelField field)
Compute the tagName of a given field.
This method return the first child tag name created by this field. This means that for a association with multiplicity * and listStyle to wrapped (which is the default), this method will return the plural tagName, while for a listStyle of flat, it will return the singular tagName.
Parameters:
field - the field we are looking for the tag name.
Returns:
the tag name to use