Package org.codehaus.modello.plugins.xml
Class AbstractXmlJavaGenerator
java.lang.Object
org.codehaus.modello.plugin.AbstractModelloGenerator
org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
org.codehaus.modello.plugins.xml.AbstractXmlJavaGenerator
- All Implemented Interfaces:
ModelloGenerator
Abstract class for plugins generating Java code for XML representation of the model.
- Author:
- Hervé Boutemy
-
Field Summary
Fields inherited from class org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
DEFAULT_DATE_FORMAT, domAsXpp3
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ModelField
getContentField
(List<ModelField> modelFields) Get the field which type isContent
if any.protected List
<ModelField> getFieldsForXml
(ModelClass modelClass, Version version) Return the XML fields of this class, with proper XML order and no XML transient fields.protected String
getFileName
(String suffix) protected String
getValue
(String type, String initialValue, XmlFieldMetadata xmlFieldMetadata) protected void
initialize
(Model model, Map<String, Object> parameters) protected String
resolveTagName
(String fieldTagName, XmlAssociationMetadata xmlAssociationMetadata) Resolve XML tag name for an item in an association with many multiplicity.protected String
resolveTagName
(ModelClass modelClass) Resolve XML tag name for a class.protected String
resolveTagName
(ModelField modelField, XmlFieldMetadata xmlFieldMetadata) Resolve XML tag name for a field.protected void
writeDateParsingHelper
(JSourceCode sc, String exception) Methods inherited from class org.codehaus.modello.plugin.java.AbstractJavaModelloGenerator
addModelImport, addModelImports, getClasses, getDefaultValue, getJavaDefaultValue, getPrefix, getValueChecker, initHeader, initHeader, isJavaEnabled, isRelevant, isTrackingSupport, newJSourceWriter, suppressAllWarnings
Methods inherited from class org.codehaus.modello.plugin.AbstractModelloGenerator
capitalise, getBuildContext, getEncoding, getFieldsForClass, getGeneratedHeader, getGeneratedVersion, getHeader, getLicenseHeader, getLogger, getModel, getOutputDirectory, getParameter, isClassInModel, isCollection, isEmpty, isInnerAssociation, isMap, isPackageWithVersion, newWriter, newWriter, requireParameter, singular, uncapitalise
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.codehaus.modello.plugin.ModelloGenerator
generate
-
Field Details
-
strictXmlAttributes
protected boolean strictXmlAttributes
-
-
Constructor Details
-
AbstractXmlJavaGenerator
public AbstractXmlJavaGenerator()
-
-
Method Details
-
initialize
- Overrides:
initialize
in classAbstractJavaModelloGenerator
- Throws:
ModelloException
-
getFileName
-
resolveTagName
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
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
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
Get the field which type isContent
if any.- Parameters:
modelFields
- the fields to check- Returns:
- the field, or
null
if no field isContent
-
getFieldsForXml
Return the XML fields of this class, with proper XML order and no XML transient fields.- Parameters:
modelClass
- current classversion
- the version of the class to use- Returns:
- the list of XML fields of this class
-
getValue
-
writeDateParsingHelper
-