BeansWrapperConfiguration (FreeMarker 2.3.23 API)
Date: 2015-07-05

freemarker.ext.beans

## Class BeansWrapperConfiguration

- java.lang.Object
- - freemarker.ext.beans.BeansWrapperConfiguration

- All Implemented Interfaces:
    Cloneable
  Direct Known Subclasses:
    BeansWrapperBuilder, DefaultObjectWrapperConfiguration

      public abstract class BeansWrapperConfiguration
      extends Object
      implements Cloneable

  Holds `BeansWrapper` configuration settings and defines their defaults. You will not use this abstract class directly, but concrete subclasses like `BeansWrapperBuilder` and `DefaultObjectWrapperBuilder`. Unless, you are developing a builder for a custom `BeansWrapper` subclass.

  This class is designed so that its instances can be used as lookup keys in a singleton cache. This is also why this class defines the configuration setting defaults for `BeansWrapper`, instead of leaving that to `BeansWrapper` itself. (Because, the default values influence the lookup key, and the singleton needs to be looked up without creating a `BeansWrapper` instance.) However, because instances are mutable, you should deep-clone it with `clone(boolean)` before using it as cache key.

  Since:
    2.3.21

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected freemarker.ext.beans.ClassIntrospectorBuilder` | `classIntrospectorFactory`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BeansWrapperConfiguration(Version incompatibleImprovements)` Same as `BeansWrapperConfiguration(Version, false)`.
    `protected` | `BeansWrapperConfiguration(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected Object` | `clone(boolean deepCloneKey)`
    `boolean` | `equals(Object obj)` Two `BeansWrapperConfiguration`-s are equal exactly if their classes are identical (`==`), and their field values are equal.
    `int` | `getDefaultDateType()`
    `boolean` | `getExposeFields()`
    `int` | `getExposureLevel()`
    `Version` | `getIncompatibleImprovements()`
    `MethodAppearanceFineTuner` | `getMethodAppearanceFineTuner()`
    `ObjectWrapper` | `getOuterIdentity()`
    `boolean` | `getUseModelCache()`
    `int` | `hashCode()`
    `boolean` | `isSimpleMapWrapper()`
    `boolean` | `isStrict()`
    `void` | `setDefaultDateType(int defaultDateType)` See `BeansWrapper.setDefaultDateType(int)`.
    `void` | `setExposeFields(boolean exposeFields)` See `BeansWrapper.setExposeFields(boolean)`.
    `void` | `setExposureLevel(int exposureLevel)` See `BeansWrapper.setExposureLevel(int)`.
    `void` | `setMethodAppearanceFineTuner(MethodAppearanceFineTuner methodAppearanceFineTuner)` See `BeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner)`; additionally, note that currently setting this to non-`null` will disable class introspection cache sharing, unless the value implements `SingletonCustomizer`.
    `void` | `setOuterIdentity(ObjectWrapper outerIdentity)` See `BeansWrapper.setOuterIdentity(ObjectWrapper)`, except here the default is `null` that means the `ObjectWrapper` that you will set up with this `BeansWrapperBuilder` object.
    `void` | `setSimpleMapWrapper(boolean simpleMapWrapper)` See `BeansWrapper.setSimpleMapWrapper(boolean)`.
    `void` | `setStrict(boolean strict)` See `BeansWrapper.setStrict(boolean)`.
    `void` | `setUseModelCache(boolean useModelCache)` See `BeansWrapper.setUseCache(boolean)` (it means the same).

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

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

- - ### Field Detail

    - #### classIntrospectorFactory

          protected freemarker.ext.beans.ClassIntrospectorBuilder classIntrospectorFactory

  - ### Constructor Detail

    - #### BeansWrapperConfiguration

          protected BeansWrapperConfiguration(Version incompatibleImprovements,
                                              boolean isIncompImprsAlreadyNormalized)

      Parameters:
        `incompatibleImprovements` - See the corresponding parameter of `BeansWrapper.BeansWrapper(Version)`. Not `null`. Note that the version will be normalized to the lowest version where the same incompatible `BeansWrapper` improvements were already present, so for the returned instance `getIncompatibleImprovements()` might returns a lower version than what you have specified here.
        `isIncompImprsAlreadyNormalized` - Tells if the `incompatibleImprovements` parameter contains an already normalized value. This parameter meant to be `true` when the class that extends `BeansWrapper` needs to add additional breaking versions over those of `BeansWrapper`. Thus, if this parameter is `true`, the versions where `BeansWrapper` had breaking changes must be already factored into the `incompatibleImprovements` parameter value, as no more normalization will happen. (You can use `BeansWrapper.normalizeIncompatibleImprovementsVersion(Version)` to discover those.)
      Since:
        2.3.22

    - #### BeansWrapperConfiguration

          protected BeansWrapperConfiguration(Version incompatibleImprovements)

      Same as `BeansWrapperConfiguration(Version, false)`.

  - ### Method Detail

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Two `BeansWrapperConfiguration`-s are equal exactly if their classes are identical (`==`), and their field values are equal.
      Overrides:
        `equals` in class `Object`

    - #### clone

          protected Object clone(boolean deepCloneKey)

    - #### isSimpleMapWrapper

          public boolean isSimpleMapWrapper()

    - #### setSimpleMapWrapper

          public void setSimpleMapWrapper(boolean simpleMapWrapper)

      See `BeansWrapper.setSimpleMapWrapper(boolean)`.

    - #### getDefaultDateType

          public int getDefaultDateType()

    - #### setDefaultDateType

          public void setDefaultDateType(int defaultDateType)

      See `BeansWrapper.setDefaultDateType(int)`.

    - #### getOuterIdentity

          public ObjectWrapper getOuterIdentity()

    - #### setOuterIdentity

          public void setOuterIdentity(ObjectWrapper outerIdentity)

      See `BeansWrapper.setOuterIdentity(ObjectWrapper)`, except here the default is `null` that means the `ObjectWrapper` that you will set up with this `BeansWrapperBuilder` object.

    - #### isStrict

          public boolean isStrict()

    - #### setStrict

          public void setStrict(boolean strict)

      See `BeansWrapper.setStrict(boolean)`.

    - #### getUseModelCache

          public boolean getUseModelCache()

    - #### setUseModelCache

          public void setUseModelCache(boolean useModelCache)

      See `BeansWrapper.setUseCache(boolean)` (it means the same).

    - #### getIncompatibleImprovements

          public Version getIncompatibleImprovements()

    - #### getExposureLevel

          public int getExposureLevel()

    - #### setExposureLevel

          public void setExposureLevel(int exposureLevel)

      See `BeansWrapper.setExposureLevel(int)`.

    - #### getExposeFields

          public boolean getExposeFields()

    - #### setExposeFields

          public void setExposeFields(boolean exposeFields)

      See `BeansWrapper.setExposeFields(boolean)`.

    - #### getMethodAppearanceFineTuner

          public MethodAppearanceFineTuner getMethodAppearanceFineTuner()

    - #### setMethodAppearanceFineTuner

          public void setMethodAppearanceFineTuner(MethodAppearanceFineTuner methodAppearanceFineTuner)

      See `BeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner)`; additionally, note that currently setting this to non-`null` will disable class introspection cache sharing, unless the value implements `SingletonCustomizer`.