Package freemarker.ext.beans
Class BeansWrapper.MethodAppearanceDecision
- java.lang.Object
-
- freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision
-
- Enclosing class:
- BeansWrapper
public static final class BeansWrapper.MethodAppearanceDecision extends java.lang.Object
Used forMethodAppearanceFineTuner.process(freemarker.ext.beans.BeansWrapper.MethodAppearanceDecisionInput, freemarker.ext.beans.BeansWrapper.MethodAppearanceDecision)
to store the results; see there.
-
-
Constructor Summary
Constructors Constructor Description MethodAppearanceDecision()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.beans.PropertyDescriptor
getExposeAsProperty()
java.lang.String
getExposeMethodAs()
boolean
getMethodShadowsProperty()
boolean
getReplaceExistingProperty()
Getter pair ofsetReplaceExistingProperty(boolean)
.void
setExposeAsProperty(java.beans.PropertyDescriptor exposeAsProperty)
void
setExposeMethodAs(java.lang.String exposeAsMethod)
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()
.
-
-
-
Method Detail
-
getExposeAsProperty
public java.beans.PropertyDescriptor getExposeAsProperty()
-
setExposeAsProperty
public void setExposeAsProperty(java.beans.PropertyDescriptor exposeAsProperty)
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
public java.lang.String getExposeMethodAs()
-
setExposeMethodAs
public void setExposeMethodAs(java.lang.String exposeAsMethod)
-
getMethodShadowsProperty
public boolean getMethodShadowsProperty()
-
setMethodShadowsProperty
public void setMethodShadowsProperty(boolean shadowEarlierProperty)
-
-