org.codehaus.modello.plugins.xml
Class AbstractXmlJavaGenerator
java.lang.Object
AbstractLogEnabled
org.codehaus.modello.plugin.AbstractModelloGenerator
org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
org.codehaus.modello.plugins.xml.AbstractXmlJavaGenerator
- All Implemented Interfaces:
- ModelloGenerator
- Direct Known Subclasses:
- AbstractJDOMGenerator, AbstractStaxGenerator, AbstractXpp3Generator, Dom4jReaderGenerator, Dom4jWriterGenerator
public abstract class AbstractXmlJavaGenerator
- extends AbstractJavaModelloGenerator
Abstract class for plugins generating Java code for XML representation of the model.
- Version:
- $Id: AbstractXmlJavaGenerator.java 1273 2009-07-04 14:46:19Z bentmann $
- Author:
- Herv?? Boutemy
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractXmlJavaGenerator
public AbstractXmlJavaGenerator()
getFileName
protected java.lang.String getFileName(java.lang.String suffix)
resolveTagName
protected java.lang.String resolveTagName(ModelClass modelClass)
- Resolve XML tag name for a class. Note: only root class needs such a resolution.
- Parameters:
modelClass
- the model class
- Returns:
- the XML tag name for the class
resolveTagName
protected java.lang.String resolveTagName(ModelField modelField,
XmlFieldMetadata xmlFieldMetadata)
- Resolve XML tag name for a field.
- Parameters:
modelField
- the model fieldxmlFieldMetadata
- the XML metadata of the field
- Returns:
- the XML tag name for the field
resolveTagName
protected java.lang.String resolveTagName(java.lang.String fieldTagName,
XmlAssociationMetadata xmlAssociationMetadata)
- Resolve XML tag name for an item in an association with many multiplicity.
- Parameters:
fieldTagName
- the XML tag name of the field containing the associationxmlAssociationMetadata
- the XML metadata of the association
- Returns:
- the XML tag name for items
getContentField
protected ModelField getContentField(java.util.List modelFields)
- Get the field which type is
Content
if any.
- Parameters:
modelFields
- the fields to check
- Returns:
- the field, or
null
if no field is Content
getNonTransientFields
protected java.util.List getNonTransientFields(java.util.List modelFields)
- Gets all fields that are not marked as transient.
- Parameters:
modelFields
- The collection of model fields from which to extract the non-transient fields, must not be
null
.
- Returns:
- The list of non-transient fields, can be empty but never
null
.
getValue
protected java.lang.String getValue(java.lang.String type,
java.lang.String initialValue,
XmlFieldMetadata xmlFieldMetadata)
writeDateParsingHelper
protected void writeDateParsingHelper(JSourceCode sc,
java.lang.String exception)