@Retention(value=RUNTIME) @Target(value={METHOD,FIELD}) @Documented public @interface DataBoundSetter
StaplerRequest.bindJSON(Class, JSONObject)
and
StaplerRequest.bindParameters(Class, String)
.
Stapler will first invoke DataBoundConstructor
-annotated constructor, and if there's any
remaining properties in JSON, it'll try to find a matching DataBoundSetter
-annotated setter
method or a field.
The setter method is discovered through Introspector
, so setter method name must match
the property name (such as setFoo for the foo property), and it needs to be public.
The field is discovered through simple reflection, so its name must match the property name, but its access modifier can be anything.
To create a method to be called after all the setter injections are complete, annotate a method
with PostConstruct
.
Copyright © 2014. All rights reserved.