Package freemarker.ext.beans
Class BeansWrapperConfiguration
- java.lang.Object
-
- freemarker.ext.beans.BeansWrapperConfiguration
-
- All Implemented Interfaces:
java.lang.Cloneable
- Direct Known Subclasses:
BeansWrapperBuilder,DefaultObjectWrapperConfiguration
public abstract class BeansWrapperConfiguration extends java.lang.Object implements java.lang.CloneableHoldsBeansWrapperconfiguration settings and defines their defaults. You will not use this abstract class directly, but concrete subclasses likeBeansWrapperBuilderandDefaultObjectWrapperBuilder. Unless, you are developing a builder for a customBeansWrappersubclass.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 toBeansWrapperitself. (Because, the default values influence the lookup key, and the singleton needs to be looked up without creating aBeansWrapperinstance.) However, because instances are mutable, you should deep-clone it withclone(boolean)before using it as cache key.- Since:
- 2.3.21
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBeansWrapperConfiguration(Version incompatibleImprovements)protectedBeansWrapperConfiguration(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Objectclone(boolean deepCloneKey)booleanequals(java.lang.Object obj)TwoBeansWrapperConfiguration-s are equal exactly if their classes are identical (==), and their field values are equal.intgetDefaultDateType()booleangetExposeFields()intgetExposureLevel()VersiongetIncompatibleImprovements()MemberAccessPolicygetMemberAccessPolicy()MethodAppearanceFineTunergetMethodAppearanceFineTuner()ObjectWrappergetOuterIdentity()booleangetPreferIndexedReadMethod()booleangetTreatDefaultMethodsAsBeanMembers()booleangetUseModelCache()inthashCode()booleanisSimpleMapWrapper()booleanisStrict()voidsetDefaultDateType(int defaultDateType)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)voidsetSimpleMapWrapper(boolean simpleMapWrapper)voidsetStrict(boolean strict)voidsetTreatDefaultMethodsAsBeanMembers(boolean treatDefaultMethodsAsBeanMembers)voidsetUseModelCache(boolean useModelCache)SeeBeansWrapper.setUseCache(boolean)(it means the same).
-
-
-
Constructor Detail
-
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 returns 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
protected BeansWrapperConfiguration(Version incompatibleImprovements)
-
-
Method Detail
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
TwoBeansWrapperConfiguration-s are equal exactly if their classes are identical (==), and their field values are equal.- Overrides:
equalsin classjava.lang.Object
-
clone
protected java.lang.Object clone(boolean deepCloneKey)
-
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
public ObjectWrapper getOuterIdentity()
-
setOuterIdentity
public void setOuterIdentity(ObjectWrapper outerIdentity)
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
public Version getIncompatibleImprovements()
-
getExposureLevel
public int getExposureLevel()
-
setExposureLevel
public void setExposureLevel(int exposureLevel)
-
getExposeFields
public boolean getExposeFields()
-
setExposeFields
public void setExposeFields(boolean exposeFields)
-
getMemberAccessPolicy
public MemberAccessPolicy getMemberAccessPolicy()
-
setMemberAccessPolicy
public void setMemberAccessPolicy(MemberAccessPolicy memberAccessPolicy)
-
getTreatDefaultMethodsAsBeanMembers
public boolean getTreatDefaultMethodsAsBeanMembers()
-
setTreatDefaultMethodsAsBeanMembers
public void setTreatDefaultMethodsAsBeanMembers(boolean treatDefaultMethodsAsBeanMembers)
-
getMethodAppearanceFineTuner
public MethodAppearanceFineTuner getMethodAppearanceFineTuner()
-
setMethodAppearanceFineTuner
public void setMethodAppearanceFineTuner(MethodAppearanceFineTuner methodAppearanceFineTuner)
SeeBeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner); additionally, note that currently setting this to non-nullwill disable class introspection cache sharing, unless the value implementsSingletonCustomizer.
-
-