Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.kohsuke.stapler;
 
 
 import static java.lang.annotation.ElementType.CONSTRUCTOR;
 import static java.lang.annotation.RetentionPolicy.RUNTIME;
Designates the constructor to be created from methods like StaplerRequest.bindJSON(java.lang.Class,net.sf.json.JSONObject) and StaplerRequest.bindParameters(java.lang.Class,java.lang.String).

Stapler will invoke the designated constructor by using arguments from the corresponding net.sf.json.JSONObject (in case of StaplerRequest.bindJSON(java.lang.Class,net.sf.json.JSONObject)) or request parameters (in case of StaplerRequest.bindParameters(java.lang.Class,java.lang.String)).

The matching is done by using the constructor parameter name. Since this information is not available at the runtime, annotation processing runs during the compilation to capture them in separate "*.stapler" files.

This replaces "@stapler-constructor" annotation.

Author(s):
Kohsuke Kawaguchi
public @interface DataBoundConstructor {
New to GrepCode? Check out our FAQ X