BeansWrapperConfiguration (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.ext.beans, class: BeansWrapperConfiguration

Package 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

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  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()`
  `ZeroArgumentNonVoidMethodPolicy`
  `getDefaultZeroArgumentNonVoidMethodPolicy()`
  Getter pair of `setDefaultZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy)`.
  `boolean`
  `getExposeFields()`
  `int`
  `getExposureLevel()`
  `Version`
  `getIncompatibleImprovements()`
  `MemberAccessPolicy`
  `getMemberAccessPolicy()`
  `MethodAppearanceFineTuner`
  `getMethodAppearanceFineTuner()`
  Getter pair of `setMethodAppearanceFineTuner(freemarker.ext.beans.MethodAppearanceFineTuner)`
  `ObjectWrapper`
  `getOuterIdentity()`
  `boolean`
  `getPreferIndexedReadMethod()`
  `ZeroArgumentNonVoidMethodPolicy`
  `getRecordZeroArgumentNonVoidMethodPolicy()`
  Getter pair of `setRecordZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy)`.
  `boolean`
  `getTreatDefaultMethodsAsBeanMembers()`
  `boolean`
  `getUseModelCache()`
  `int`
  `hashCode()`
  `boolean`
  `isSimpleMapWrapper()`
  `boolean`
  `isStrict()`
  `void`
  `setDefaultDateType​(int defaultDateType)`
  See `BeansWrapper.setDefaultDateType(int)`.
  `void`
  `setDefaultZeroArgumentNonVoidMethodPolicy​(ZeroArgumentNonVoidMethodPolicy defaultZeroArgumentNonVoidMethodPolicy)`
  See `BeansWrapper.setDefaultZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy)`.
  `void`
  `setExposeFields​(boolean exposeFields)`
  See `BeansWrapper.setExposeFields(boolean)`.
  `void`
  `setExposureLevel​(int exposureLevel)`
  See `BeansWrapper.setExposureLevel(int)`.
  `void`
  `setMemberAccessPolicy​(MemberAccessPolicy memberAccessPolicy)`
  See `BeansWrapper.setMemberAccessPolicy(MemberAccessPolicy)`.
  `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`
  `setPreferIndexedReadMethod​(boolean preferIndexedReadMethod)`
  See `BeansWrapper.setPreferIndexedReadMethod(boolean)`.
  `void`
  `setRecordZeroArgumentNonVoidMethodPolicy​(ZeroArgumentNonVoidMethodPolicy recordZeroArgumentNonVoidMethodPolicy)`
  See `BeansWrapper.setRecordZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy)`
  `void`
  `setSimpleMapWrapper​(boolean simpleMapWrapper)`
  See `BeansWrapper.setSimpleMapWrapper(boolean)`.
  `void`
  `setStrict​(boolean strict)`
  See `BeansWrapper.setStrict(boolean)`.
  `void`
  `setTreatDefaultMethodsAsBeanMembers​(boolean treatDefaultMethodsAsBeanMembers)`
  See `BeansWrapper.setTreatDefaultMethodsAsBeanMembers(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`

- ## Constructor Details

  - ### BeansWrapperConfiguration

    protected BeansWrapperConfiguration​(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized)
    Parameters:
      `incompatibleImprovements` - See the corresponding parameter of `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 return 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 Details

  - ### 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)`.

  - ### getPreferIndexedReadMethod

    public boolean getPreferIndexedReadMethod()
    Since:
      2.3.27

  - ### setPreferIndexedReadMethod

    public void setPreferIndexedReadMethod​(boolean preferIndexedReadMethod)
    See `BeansWrapper.setPreferIndexedReadMethod(boolean)`. @since 2.3.27

  - ### 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)`.

  - ### getMemberAccessPolicy

    public MemberAccessPolicy getMemberAccessPolicy()

  - ### setMemberAccessPolicy

    public void setMemberAccessPolicy​(MemberAccessPolicy memberAccessPolicy)
    See `BeansWrapper.setMemberAccessPolicy(MemberAccessPolicy)`.

  - ### getTreatDefaultMethodsAsBeanMembers

    public boolean getTreatDefaultMethodsAsBeanMembers()

  - ### setTreatDefaultMethodsAsBeanMembers

    public void setTreatDefaultMethodsAsBeanMembers​(boolean treatDefaultMethodsAsBeanMembers)
    See `BeansWrapper.setTreatDefaultMethodsAsBeanMembers(boolean)`

  - ### getDefaultZeroArgumentNonVoidMethodPolicy

    public ZeroArgumentNonVoidMethodPolicy getDefaultZeroArgumentNonVoidMethodPolicy()
    Getter pair of `setDefaultZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy)`.
    Since:
      2.3.33

  - ### setDefaultZeroArgumentNonVoidMethodPolicy

    public void setDefaultZeroArgumentNonVoidMethodPolicy​(ZeroArgumentNonVoidMethodPolicy defaultZeroArgumentNonVoidMethodPolicy)
    See `BeansWrapper.setDefaultZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy)`.

    Note that methods in this class are inherited by `DefaultObjectWrapperBuilder`, which is what you normally use.

    Since:
      2.3.33

  - ### getRecordZeroArgumentNonVoidMethodPolicy

    public ZeroArgumentNonVoidMethodPolicy getRecordZeroArgumentNonVoidMethodPolicy()
    Getter pair of `setRecordZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy)`.
    Since:
      2.3.33

  - ### setRecordZeroArgumentNonVoidMethodPolicy

    public void setRecordZeroArgumentNonVoidMethodPolicy​(ZeroArgumentNonVoidMethodPolicy recordZeroArgumentNonVoidMethodPolicy)
    See `BeansWrapper.setRecordZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy)`

    Note that methods in this class are inherited by `DefaultObjectWrapperBuilder`, which is what you normally use.

    Since:
      2.3.33

  - ### getMethodAppearanceFineTuner

    public MethodAppearanceFineTuner getMethodAppearanceFineTuner()
    Getter pair of `setMethodAppearanceFineTuner(freemarker.ext.beans.MethodAppearanceFineTuner)`

  - ### 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`.

    Note that methods in this class are inherited by `DefaultObjectWrapperBuilder`, which is what you normally use.