Class BeansWrapperConfiguration
- All Implemented Interfaces:
Cloneable
- Direct Known Subclasses:
BeansWrapperBuilder,DefaultObjectWrapperConfiguration
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
ConstructorsModifierConstructorDescriptionprotectedBeansWrapperConfiguration(Version incompatibleImprovements)protectedBeansWrapperConfiguration(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized) -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone(boolean deepCloneKey)booleanTwoBeansWrapperConfiguration-s are equal exactly if their classes are identical (==), and their field values are equal.intbooleanintbooleanbooleanbooleaninthashCode()booleanbooleanisStrict()voidsetDefaultDateType(int defaultDateType)voidsetDefaultZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy defaultZeroArgumentNonVoidMethodPolicy)voidsetExposeFields(boolean exposeFields)voidsetExposureLevel(int exposureLevel)voidsetMemberAccessPolicy(MemberAccessPolicy memberAccessPolicy)voidsetMethodAppearanceFineTuner(MethodAppearanceFineTuner methodAppearanceFineTuner)SeeBeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner); additionally, note that currently setting this to non-nullwill disable class introspection cache sharing, unless the value implementsSingletonCustomizer.voidsetOuterIdentity(ObjectWrapper outerIdentity)SeeBeansWrapper.setOuterIdentity(ObjectWrapper), except here the default isnullthat means theObjectWrapperthat you will set up with thisBeansWrapperBuilderobject.voidsetPreferIndexedReadMethod(boolean preferIndexedReadMethod)voidsetRecordZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy recordZeroArgumentNonVoidMethodPolicy)voidsetSimpleMapWrapper(boolean simpleMapWrapper)voidsetStrict(boolean strict)voidsetTreatDefaultMethodsAsBeanMembers(boolean treatDefaultMethodsAsBeanMembers)voidsetUseModelCache(boolean useModelCache)SeeBeansWrapper.setUseCache(boolean)(it means the same).
-
Constructor Details
-
BeansWrapperConfiguration
protected BeansWrapperConfiguration(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized)- Parameters:
incompatibleImprovements- See the corresponding parameter ofBeansWrapper(Version). Notnull. Note that the version will be normalized to the lowest version where the same incompatibleBeansWrapperimprovements were already present, so for the returned instancegetIncompatibleImprovements()might return a lower version than what you have specified here.isIncompImprsAlreadyNormalized- Tells if theincompatibleImprovementsparameter contains an already normalized value. This parameter meant to betruewhen the class that extendsBeansWrapperneeds to add additional breaking versions over those ofBeansWrapper. Thus, if this parameter istrue, the versions whereBeansWrapperhad breaking changes must be already factored into theincompatibleImprovementsparameter value, as no more normalization will happen. (You can useBeansWrapper.normalizeIncompatibleImprovementsVersion(Version)to discover those.)- Since:
- 2.3.22
-
BeansWrapperConfiguration
-
-
Method Details
-
hashCode
public int hashCode() -
equals
TwoBeansWrapperConfiguration-s are equal exactly if their classes are identical (==), and their field values are equal. -
clone
-
isSimpleMapWrapper
public boolean isSimpleMapWrapper() -
setSimpleMapWrapper
public void setSimpleMapWrapper(boolean simpleMapWrapper) -
getPreferIndexedReadMethod
public boolean getPreferIndexedReadMethod()- Since:
- 2.3.27
-
setPreferIndexedReadMethod
public void setPreferIndexedReadMethod(boolean preferIndexedReadMethod)SeeBeansWrapper.setPreferIndexedReadMethod(boolean). @since 2.3.27 -
getDefaultDateType
public int getDefaultDateType() -
setDefaultDateType
public void setDefaultDateType(int defaultDateType) -
getOuterIdentity
-
setOuterIdentity
SeeBeansWrapper.setOuterIdentity(ObjectWrapper), except here the default isnullthat means theObjectWrapperthat you will set up with thisBeansWrapperBuilderobject. -
isStrict
public boolean isStrict() -
setStrict
public void setStrict(boolean strict) -
getUseModelCache
public boolean getUseModelCache() -
setUseModelCache
public void setUseModelCache(boolean useModelCache)SeeBeansWrapper.setUseCache(boolean)(it means the same). -
getIncompatibleImprovements
-
getExposureLevel
public int getExposureLevel() -
setExposureLevel
public void setExposureLevel(int exposureLevel) -
getExposeFields
public boolean getExposeFields() -
setExposeFields
public void setExposeFields(boolean exposeFields) -
getMemberAccessPolicy
-
setMemberAccessPolicy
-
getTreatDefaultMethodsAsBeanMembers
public boolean getTreatDefaultMethodsAsBeanMembers() -
setTreatDefaultMethodsAsBeanMembers
public void setTreatDefaultMethodsAsBeanMembers(boolean treatDefaultMethodsAsBeanMembers) -
getDefaultZeroArgumentNonVoidMethodPolicy
Getter pair ofsetDefaultZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy).- Since:
- 2.3.33
-
setDefaultZeroArgumentNonVoidMethodPolicy
public void setDefaultZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy defaultZeroArgumentNonVoidMethodPolicy)SeeBeansWrapper.setDefaultZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy).Note that methods in this class are inherited by
DefaultObjectWrapperBuilder, which is what you normally use.- Since:
- 2.3.33
-
getRecordZeroArgumentNonVoidMethodPolicy
Getter pair ofsetRecordZeroArgumentNonVoidMethodPolicy(freemarker.ext.beans.ZeroArgumentNonVoidMethodPolicy).- Since:
- 2.3.33
-
setRecordZeroArgumentNonVoidMethodPolicy
public void setRecordZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy recordZeroArgumentNonVoidMethodPolicy)SeeBeansWrapper.setRecordZeroArgumentNonVoidMethodPolicy(ZeroArgumentNonVoidMethodPolicy)Note that methods in this class are inherited by
DefaultObjectWrapperBuilder, which is what you normally use.- Since:
- 2.3.33
-
getMethodAppearanceFineTuner
-
setMethodAppearanceFineTuner
SeeBeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner); additionally, note that currently setting this to non-nullwill disable class introspection cache sharing, unless the value implementsSingletonCustomizer.Note that methods in this class are inherited by
DefaultObjectWrapperBuilder, which is what you normally use.
-