Package freemarker.ext.beans
Class BeansWrapper.MethodAppearanceDecision
java.lang.Object
freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision
- Enclosing class:
- BeansWrapper
Used for
MethodAppearanceFineTuner.process(freemarker.ext.beans.BeansWrapper.MethodAppearanceDecisionInput, freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision)
to store the results; see there.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
Getter pair ofsetReplaceExistingProperty(boolean)
.boolean
void
setExposeAsProperty(PropertyDescriptor exposeAsProperty)
void
setExposeMethodAs(String exposeAsMethod)
void
setMethodInsteadOfPropertyValueBeforeCall(boolean methodInsteadOfPropertyValueBeforeCall)
void
setMethodShadowsProperty(boolean shadowEarlierProperty)
void
setReplaceExistingProperty(boolean overrideExistingProperty)
IfgetExposeAsProperty()
is non-null
, and aPropertyDescriptor
with the same property name was already added to the class introspection data, this decides if that will be replaced with thePropertyDescriptor
returned bygetExposeAsProperty()
.
-
Constructor Details
-
MethodAppearanceDecision
public MethodAppearanceDecision()
-
-
Method Details
-
getExposeAsProperty
-
setExposeAsProperty
See in the documentation ofMethodAppearanceFineTuner.process(freemarker.ext.beans.BeansWrapper.MethodAppearanceDecisionInput, freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision)
. Note that you may also want to callsetMethodShadowsProperty(false)
when you call this. -
getReplaceExistingProperty
public boolean getReplaceExistingProperty()Getter pair ofsetReplaceExistingProperty(boolean)
.- Since:
- 2.3.28
-
setReplaceExistingProperty
public void setReplaceExistingProperty(boolean overrideExistingProperty)IfgetExposeAsProperty()
is non-null
, and aPropertyDescriptor
with the same property name was already added to the class introspection data, this decides if that will be replaced with thePropertyDescriptor
returned bygetExposeAsProperty()
. The default isfalse
, that is, the oldPropertyDescriptor
is kept, and the new one is ignored. JavaBean properties discovered with the standard (non-MethodAppearanceFineTuner
) mechanism are added before those created by theMethodAppearanceFineTuner
, so with this you can decide if a real JavaBeans property can be replaced by the "fake" one created withsetExposeAsProperty(PropertyDescriptor)
.- Since:
- 2.3.28
-
getExposeMethodAs
-
setExposeMethodAs
-
getMethodShadowsProperty
public boolean getMethodShadowsProperty() -
setMethodShadowsProperty
public void setMethodShadowsProperty(boolean shadowEarlierProperty) -
isMethodInsteadOfPropertyValueBeforeCall
public boolean isMethodInsteadOfPropertyValueBeforeCall()See in the documentation ofMethodAppearanceFineTuner.process(freemarker.ext.beans.BeansWrapper.MethodAppearanceDecisionInput, freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision)
.- Since:
- 2.3.33
-
setMethodInsteadOfPropertyValueBeforeCall
public void setMethodInsteadOfPropertyValueBeforeCall(boolean methodInsteadOfPropertyValueBeforeCall)See in the documentation ofMethodAppearanceFineTuner.process(freemarker.ext.beans.BeansWrapper.MethodAppearanceDecisionInput, freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision)
.- Since:
- 2.3.33
-