Class AbstractXmlJavaGenerator

All Implemented Interfaces:
ModelloGenerator

public abstract class AbstractXmlJavaGenerator extends AbstractJavaModelloGenerator
Abstract class for plugins generating Java code for XML representation of the model.
Author:
Hervé Boutemy
  • Field Details

    • strictXmlAttributes

      protected boolean strictXmlAttributes
  • Constructor Details

    • AbstractXmlJavaGenerator

      public AbstractXmlJavaGenerator()
  • Method Details

    • initialize

      protected void initialize(Model model, Properties parameters) throws ModelloException
      Overrides:
      initialize in class AbstractJavaModelloGenerator
      Throws:
      ModelloException
    • getFileName

      protected String getFileName(String suffix)
    • resolveTagName

      protected 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 String resolveTagName(ModelField modelField, XmlFieldMetadata xmlFieldMetadata)
      Resolve XML tag name for a field.
      Parameters:
      modelField - the model field
      xmlFieldMetadata - the XML metadata of the field
      Returns:
      the XML tag name for the field
    • resolveTagName

      protected String resolveTagName(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 association
      xmlAssociationMetadata - the XML metadata of the association
      Returns:
      the XML tag name for items
    • getContentField

      protected ModelField getContentField(List<ModelField> 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
    • getFieldsForXml

      protected List<ModelField> getFieldsForXml(ModelClass modelClass, Version version)
      Return the XML fields of this class, with proper XML order and no XML transient fields.
      Parameters:
      modelClass - current class
      version - the version of the class to use
      Returns:
      the list of XML fields of this class
    • getValue

      protected String getValue(String type, String initialValue, XmlFieldMetadata xmlFieldMetadata)
    • writeDateParsingHelper

      protected void writeDateParsingHelper(JSourceCode sc, String exception)