/** * Returns whether exposure of public instance fields of classes is * enabled. See {@link #setExposeFields(boolean)} for details. * @return true if public instance fields are exposed, false otherwise. * * @since 2.3.26 */ public boolean isExposeFields() { return classIntrospector.getExposeFields(); }
/** * Returns the name-value pairs that describe the configuration of this {@link BeansWrapper}; called from * {@link #toString()}. The expected format is like {@code "foo=bar, baaz=wombat"}. When overriding this, you should * call the super method, and then insert the content before it with a following {@code ", "}, or after it with a * preceding {@code ", "}. * * @since 2.3.22 */ protected String toPropertiesString() { // Start with "simpleMapWrapper", because the override in DefaultObjectWrapper expects it to be there! return "simpleMapWrapper=" + simpleMapWrapper + ", " + "exposureLevel=" + classIntrospector.getExposureLevel() + ", " + "exposeFields=" + classIntrospector.getExposeFields() + ", " + "preferIndexedReadMethod=" + preferIndexedReadMethod + ", " + "treatDefaultMethodsAsBeanMembers=" + classIntrospector.getTreatDefaultMethodsAsBeanMembers() + ", " + "sharedClassIntrospCache=" + (classIntrospector.isShared() ? "@" + System.identityHashCode(classIntrospector) : "none"); }
/** * Controls whether public instance fields of classes are exposed to * templates. * @param exposeFields if set to true, public instance fields of classes * that do not have a property getter defined can be accessed directly by * their name. If there is a property getter for a property of the same * name as the field (i.e. getter "getFoo()" and field "foo"), then * referring to "foo" in template invokes the getter. If set to false, no * access to public instance fields of classes is given. Default is false. */ public void setExposeFields(boolean exposeFields) { checkModifiable(); if (classIntrospector.getExposeFields() != exposeFields) { ClassIntrospectorBuilder builder = classIntrospector.createBuilder(); builder.setExposeFields(exposeFields); replaceClassIntrospector(builder); } }
/** * Returns whether exposure of public instance fields of classes is * enabled. See {@link #setExposeFields(boolean)} for details. * @return true if public instance fields are exposed, false otherwise. * * @since 2.3.26 */ public boolean isExposeFields() { return classIntrospector.getExposeFields(); }
/** * Returns whether exposure of public instance fields of classes is * enabled. See {@link #setExposeFields(boolean)} for details. * @return true if public instance fields are exposed, false otherwise. * * @since 2.3.26 */ public boolean isExposeFields() { return classIntrospector.getExposeFields(); }
/** * Returns the name-value pairs that describe the configuration of this {@link BeansWrapper}; called from * {@link #toString()}. The expected format is like {@code "foo=bar, baaz=wombat"}. When overriding this, you should * call the super method, and then insert the content before it with a following {@code ", "}, or after it with a * preceding {@code ", "}. * * @since 2.3.22 */ protected String toPropertiesString() { // Start with "simpleMapWrapper", because the override in DefaultObjectWrapper expects it to be there! return "simpleMapWrapper=" + simpleMapWrapper + ", " + "exposureLevel=" + classIntrospector.getExposureLevel() + ", " + "exposeFields=" + classIntrospector.getExposeFields() + ", " + "preferIndexedReadMethod=" + preferIndexedReadMethod + ", " + "treatDefaultMethodsAsBeanMembers=" + classIntrospector.getTreatDefaultMethodsAsBeanMembers() + ", " + "sharedClassIntrospCache=" + (classIntrospector.isShared() ? "@" + System.identityHashCode(classIntrospector) : "none"); }
/** * Returns the name-value pairs that describe the configuration of this {@link BeansWrapper}; called from * {@link #toString()}. The expected format is like {@code "foo=bar, baaz=wombat"}. When overriding this, you should * call the super method, and then insert the content before it with a following {@code ", "}, or after it with a * preceding {@code ", "}. * * @since 2.3.22 */ protected String toPropertiesString() { // Start with "simpleMapWrapper", because the override in DefaultObjectWrapper expects it to be there! return "simpleMapWrapper=" + simpleMapWrapper + ", " + "exposureLevel=" + classIntrospector.getExposureLevel() + ", " + "exposeFields=" + classIntrospector.getExposeFields() + ", " + "preferIndexedReadMethod=" + preferIndexedReadMethod + ", " + "treatDefaultMethodsAsBeanMembers=" + classIntrospector.getTreatDefaultMethodsAsBeanMembers() + ", " + "sharedClassIntrospCache=" + (classIntrospector.isShared() ? "@" + System.identityHashCode(classIntrospector) : "none"); }
/** * Controls whether public instance fields of classes are exposed to * templates. * @param exposeFields if set to true, public instance fields of classes * that do not have a property getter defined can be accessed directly by * their name. If there is a property getter for a property of the same * name as the field (i.e. getter "getFoo()" and field "foo"), then * referring to "foo" in template invokes the getter. If set to false, no * access to public instance fields of classes is given. Default is false. */ public void setExposeFields(boolean exposeFields) { checkModifiable(); if (classIntrospector.getExposeFields() != exposeFields) { ClassIntrospectorBuilder builder = classIntrospector.createBuilder(); builder.setExposeFields(exposeFields); replaceClassIntrospector(builder); } }
/** * Controls whether public instance fields of classes are exposed to * templates. * @param exposeFields if set to true, public instance fields of classes * that do not have a property getter defined can be accessed directly by * their name. If there is a property getter for a property of the same * name as the field (i.e. getter "getFoo()" and field "foo"), then * referring to "foo" in template invokes the getter. If set to false, no * access to public instance fields of classes is given. Default is false. */ public void setExposeFields(boolean exposeFields) { checkModifiable(); if (classIntrospector.getExposeFields() != exposeFields) { ClassIntrospectorBuilder builder = classIntrospector.createBuilder(); builder.setExposeFields(exposeFields); replaceClassIntrospector(builder); } }