private void appendDedicatedClassProperty(DAClassWriter<DAFileWriter> classWriter,
                                            DASourceClass sourceClass,
                                            DAMethod dedicatedClassConstructor) throws IOException {
    List<DAParameter> constructorParameters = dedicatedClassConstructor.getParameters();
    if (constructorParameters.isEmpty()) {
      classWriter.newInitializedProperty(DEDICATED_CLASS_INSTANCE_PROPERTY_NAME, sourceClass.getType())
                 .withModifiers(DAModifier.PRIVATE, DAModifier.FINAL)
                 .initialize()
                   .append("new ").appendType(sourceClass.getType())
                   .appendParamValues(Collections.<DAParameter>emptyList())
                   .end()
                 .end();
    }
    else {
      classWriter.newProperty(DEDICATED_CLASS_INSTANCE_PROPERTY_NAME, sourceClass.getType())
                 .withModifiers(DAModifier.PRIVATE, DAModifier.FINAL)
                 .write();
    }
  }
private void appendDedicatedClassProperty ( DAClassWriter < DAFileWriter > classWriter , DASourceClass sourceClass , DAMethod dedicatedClassConstructor ) throws IOException { List < DAParameter > constructorParameters = dedicatedClassConstructor . getParameters ( ) ; if ( constructorParameters . isEmpty ( ) ) { classWriter . newInitializedProperty ( DEDICATED_CLASS_INSTANCE_PROPERTY_NAME , sourceClass . getType ( ) ) . withModifiers ( DAModifier . PRIVATE , DAModifier . FINAL ) . initialize ( ) . append ( "new " ) . appendType ( sourceClass . getType ( ) ) . appendParamValues ( Collections . < DAParameter > emptyList ( ) ) . end ( ) . end ( ) ; } else { classWriter . newProperty ( DEDICATED_CLASS_INSTANCE_PROPERTY_NAME , sourceClass . getType ( ) ) . withModifiers ( DAModifier . PRIVATE , DAModifier . FINAL ) . write ( ) ; } }
Adds a property storing an instance of the dedicated class called {@link #DEDICATED_CLASS_INSTANCE_PROPERTY_NAME}.
If the dedicated class's constructor has no parameter, the property is initialized when it is declared, otherwise
it will be initialized in the MapperImpl's constructor.