Class Xpp3ReaderGenerator

All Implemented Interfaces:
ModelloGenerator, org.codehaus.plexus.logging.LogEnabled, org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable
Direct Known Subclasses:
Xpp3ExtendedReaderGenerator

@Component(role=ModelloGenerator.class, hint="xpp3-reader") public class Xpp3ReaderGenerator extends AbstractXpp3Generator
  • Field Details

  • Constructor Details

    • Xpp3ReaderGenerator

      public Xpp3ReaderGenerator()
  • Method Details

    • initialize

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

      public void generate(Model model, Properties parameters) throws ModelloException
      Throws:
      ModelloException
    • writeAllClassesReaders

      private void writeAllClassesReaders(Model objectModel, JClass jClass)
    • writeClassReaders

      private void writeClassReaders(ModelClass modelClass, JClass jClass, boolean rootElement)
    • generateXpp3Reader

      private void generateXpp3Reader() throws ModelloException, IOException
      Throws:
      ModelloException
      IOException
    • writeAllClassesParser

      private void writeAllClassesParser(Model objectModel, JClass jClass)
    • writeClassParser

      private void writeClassParser(ModelClass modelClass, JClass jClass, boolean rootElement)
    • writeClassAttributesParser

      private ModelField writeClassAttributesParser(List<ModelField> modelFields, String objectName, boolean rootElement, JSourceCode sc, JClass jClass)
    • processField

      private void processField(ModelField field, XmlFieldMetadata xmlFieldMetadata, boolean addElse, JSourceCode sc, String objectName, JClass jClass)
      Generate code to process a field represented as an XML element.
      Parameters:
      field - the field to process
      xmlFieldMetadata - its XML metadata
      addElse - add an else statement before generating a new if
      sc - the method source code to add to
      objectName - the object name in the source
      jClass - the generated class source file
    • writePrimitiveField

      private void writePrimitiveField(ModelField field, String type, String objectName, String locatorName, String locationKey, String setterName, JSourceCode sc)
    • writeBuildDomMethod

      private void writeBuildDomMethod(JClass jClass)
    • writeBuildDomLocationTrackingMethod

      private void writeBuildDomLocationTrackingMethod(JClass jClass)
    • writeHelpers

      private void writeHelpers(JClass jClass)
    • getCheckUnknonwElement2Method

      private JMethod getCheckUnknonwElement2Method()
    • getNextTagMethod

      private JMethod getNextTagMethod()
    • getCheckUnknownAttributeMethod

      private JMethod getCheckUnknownAttributeMethod()
    • getCheckFieldWithDuplicateMethod

      private JMethod getCheckFieldWithDuplicateMethod()
    • getDateValue2Method

      private JMethod getDateValue2Method()
    • getDateValueMethod

      private JMethod getDateValueMethod()
    • getCharacterValueMethod

      private JMethod getCharacterValueMethod()
    • getBooleanValue2Method

      private JMethod getBooleanValue2Method()
    • getBooleanValueMethod

      private JMethod getBooleanValueMethod()
    • getRequiredAttributeValueMethod

      private JMethod getRequiredAttributeValueMethod()
    • getTrimmedValueMethod

      private JMethod getTrimmedValueMethod()
    • getInterpolatedTrimmed

      private JMethod getInterpolatedTrimmed()
    • convertNumericalType

      private JMethod convertNumericalType(String methodName, JType returnType, String expression, String typeDesc)
    • addTrackingParameters

      private void addTrackingParameters(JMethod method)
    • writeNewSetLocation

      private void writeNewSetLocation(ModelField field, String objectName, String trackerVariable, JSourceCode sc)
    • writeNewSetLocation

      private void writeNewSetLocation(String key, String objectName, String trackerVariable, JSourceCode sc)
    • writeNewLocation

      private void writeNewLocation(String trackerVariable, JSourceCode sc)
    • buildNewLocation

      private String buildNewLocation(String source)
    • writeSetLocation

      private void writeSetLocation(String key, String objectName, String trackerVariable, JSourceCode sc)