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.Cloneable
HoldsBeansWrapper
configuration settings and defines their defaults. You will not use this abstract class directly, but concrete subclasses likeBeansWrapperBuilder
andDefaultObjectWrapperBuilder
. Unless, you are developing a builder for a customBeansWrapper
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 toBeansWrapper
itself. (Because, the default values influence the lookup key, and the singleton needs to be looked up without creating aBeansWrapper
instance.) 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 protected
BeansWrapperConfiguration(Version incompatibleImprovements)
protected
BeansWrapperConfiguration(Version incompatibleImprovements, boolean isIncompImprsAlreadyNormalized)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Object
clone(boolean deepCloneKey)
boolean
equals(java.lang.Object obj)
TwoBeansWrapperConfiguration
-s are equal exactly if their classes are identical (==
), and their field values are equal.int
getDefaultDateType()
boolean
getExposeFields()
int
getExposureLevel()
Version
getIncompatibleImprovements()
MemberAccessPolicy
getMemberAccessPolicy()
MethodAppearanceFineTuner
getMethodAppearanceFineTuner()
ObjectWrapper
getOuterIdentity()
boolean
getPreferIndexedReadMethod()
boolean
getTreatDefaultMethodsAsBeanMembers()
boolean
getUseModelCache()
int
hashCode()
boolean
isSimpleMapWrapper()
boolean
isStrict()
void
setDefaultDateType(int defaultDateType)
void
setExposeFields(boolean exposeFields)
void
setExposureLevel(int exposureLevel)
void
setMemberAccessPolicy(MemberAccessPolicy memberAccessPolicy)
void
setMethodAppearanceFineTuner(MethodAppearanceFineTuner methodAppearanceFineTuner)
SeeBeansWrapper.setMethodAppearanceFineTuner(MethodAppearanceFineTuner)
; additionally, note that currently setting this to non-null
will disable class introspection cache sharing, unless the value implementsSingletonCustomizer
.void
setOuterIdentity(ObjectWrapper outerIdentity)
SeeBeansWrapper.setOuterIdentity(ObjectWrapper)
, except here the default isnull
that means theObjectWrapper
that you will set up with thisBeansWrapperBuilder
object.void
setPreferIndexedReadMethod(boolean preferIndexedReadMethod)
void
setSimpleMapWrapper(boolean simpleMapWrapper)
void
setStrict(boolean strict)
void
setTreatDefaultMethodsAsBeanMembers(boolean treatDefaultMethodsAsBeanMembers)
void
setUseModelCache(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 incompatibleBeansWrapper
improvements were already present, so for the returned instancegetIncompatibleImprovements()
might returns a lower version than what you have specified here.isIncompImprsAlreadyNormalized
- Tells if theincompatibleImprovements
parameter contains an already normalized value. This parameter meant to betrue
when the class that extendsBeansWrapper
needs to add additional breaking versions over those ofBeansWrapper
. Thus, if this parameter istrue
, the versions whereBeansWrapper
had breaking changes must be already factored into theincompatibleImprovements
parameter 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:
hashCode
in 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:
equals
in 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 isnull
that means theObjectWrapper
that you will set up with thisBeansWrapperBuilder
object.
-
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-null
will disable class introspection cache sharing, unless the value implementsSingletonCustomizer
.
-
-