org.appng.api.support.field

## Class FieldConversionFactory

- java.lang.Object
- - org.appng.api.support.field.FieldConversionFactory

- All Implemented Interfaces:
    FieldConverter, org.springframework.beans.factory.InitializingBean

      public class FieldConversionFactory
      extends Object
      implements FieldConverter, org.springframework.beans.factory.InitializingBean

  A `FieldConverter` encapsulating all the other `FieldConverter`s, thus providing the ability to convert any `FieldType`.
  Author:
    Matthias Müller

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.appng.api.FieldConverter

      `FieldConverter.DatafieldOwner, FieldConverter.FieldDefOwner`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FieldConversionFactory()`
    `FieldConversionFactory(ExpressionEvaluator expressionEvaluator)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Datafield` | `addField(FieldConverter.DatafieldOwner dataFieldOwner, FieldWrapper fieldWrapper)` Creates a `Datafield` and add it to the given `FieldConverter.DatafieldOwner`, using `FieldWrapper.getStringValue()` for the `Datafield`'s value.
    `void` | `afterPropertiesSet()`
    `org.springframework.core.convert.ConversionService` | `getConversionService()`
    `Environment` | `getEnvironment()`
    `org.springframework.context.MessageSource` | `getMessageSource()`
    `void` | `reset(FieldWrapper field)`
    `void` | `setConversionService(org.springframework.core.convert.ConversionService conversionService)`
    `void` | `setEnvironment(Environment environment)`
    `void` | `setMessageSource(org.springframework.context.MessageSource messageSource)`
    `void` | `setObject(FieldWrapper field, RequestContainer request)` Sets the `Object` for the given `FieldWrapper`, using the given `RequestContainer` as the parameter source.
    `void` | `setString(FieldWrapper field)` Transforms the property identified by `FieldWrapper.getBinding()` to it's `String` representation, which is used as an argument for `Datafield.setValue(String)` in `FieldConverter.addField(DatafieldOwner, FieldWrapper)`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FieldConversionFactory

          public FieldConversionFactory()

    - #### FieldConversionFactory

          public FieldConversionFactory(ExpressionEvaluator expressionEvaluator)

  - ### Method Detail

    - #### reset

          public void reset(FieldWrapper field)

      Specified by:
        `reset` in interface `FieldConverter`

    - #### addField

          public Datafield addField(FieldConverter.DatafieldOwner dataFieldOwner,
                                    FieldWrapper fieldWrapper)

      Description copied from interface: `FieldConverter`
      Creates a `Datafield` and add it to the given `FieldConverter.DatafieldOwner`, using `FieldWrapper.getStringValue()` for the `Datafield`'s value.
      Specified by:
        `addField` in interface `FieldConverter`
      Parameters:
        `dataFieldOwner` - the `FieldWrapper`
        `fieldWrapper` - the `FieldWrapper`
      Returns:
        the `Datafield` which has been added, if any

    - #### setString

          public void setString(FieldWrapper field)

      Description copied from interface: `FieldConverter`
      Transforms the property identified by `FieldWrapper.getBinding()` to it's `String` representation, which is used as an argument for `Datafield.setValue(String)` in `FieldConverter.addField(DatafieldOwner, FieldWrapper)`.
      Specified by:
        `setString` in interface `FieldConverter`
      Parameters:
        `field` - the `FieldWrapper`
      See Also:
        `FieldWrapper.setStringValue(String)`

    - #### setObject

          public void setObject(FieldWrapper field,
                                RequestContainer request)

      Description copied from interface: `FieldConverter`
      Sets the `Object` for the given `FieldWrapper`, using the given `RequestContainer` as the parameter source.
      Specified by:
        `setObject` in interface `FieldConverter`
      Parameters:
        `field` - the `FieldWrapper`
        `request` - the `RequestContainer`
      See Also:
        `FieldWrapper.setObject(Object)`

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      Specified by:
        `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`

    - #### getEnvironment

          public Environment getEnvironment()

    - #### setEnvironment

          public void setEnvironment(Environment environment)

    - #### getConversionService

          public org.springframework.core.convert.ConversionService getConversionService()

    - #### setConversionService

          public void setConversionService(org.springframework.core.convert.ConversionService conversionService)

    - #### getMessageSource

          public org.springframework.context.MessageSource getMessageSource()

    - #### setMessageSource

          public void setMessageSource(org.springframework.context.MessageSource messageSource)

Copyright © 2011–2023 aiticon GmbH. All rights reserved.