Package org.kohsuke.stapler
Class BindInterceptor
- java.lang.Object
-
- org.kohsuke.stapler.BindInterceptor
-
public class BindInterceptor extends Object
Intercepts (and receives callbacks) about the JSON → object binding process.- Author:
- Kohsuke Kawaguchi
- See Also:
StaplerRequest.setBindInterceptor(BindInterceptor)
,WebApp.bindInterceptors
-
-
Field Summary
Fields Modifier and Type Field Description static Object
DEFAULT
Indicates that the conversion should proceed as it normally does, and that the listener isn't replacing the process.static BindInterceptor
NOOP
DefaultBindInterceptor
that does nothing.
-
Constructor Summary
Constructors Constructor Description BindInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
instantiate(Class actualType, net.sf.json.JSONObject json)
Called for each object conversion, after the actual subtype to instantiate is determined.Object
onConvert(Type targetType, Class targetTypeErasure, Object jsonSource)
Called for each object conversion, after the expected type is determined.
-
-
-
Field Detail
-
DEFAULT
public static final Object DEFAULT
Indicates that the conversion should proceed as it normally does, and that the listener isn't replacing the process.
-
NOOP
public static final BindInterceptor NOOP
DefaultBindInterceptor
that does nothing.
-
-
Method Detail
-
onConvert
public Object onConvert(Type targetType, Class targetTypeErasure, Object jsonSource)
Called for each object conversion, after the expected type is determined.- Parameters:
targetType
- Type that the converted object must be assignable to.targetTypeErasure
- Erasure of thetargetType
parameter.jsonSource
- JSON object to be mapped to Java object.- Returns:
DEFAULT
to indicate that the default conversion process should proceed. Any other values (including null) will override the process.
-
instantiate
public Object instantiate(Class actualType, net.sf.json.JSONObject json)
Called for each object conversion, after the actual subtype to instantiate is determined.- Parameters:
actualType
- The type to instantiatejson
- JSON object to be mapped to Java object.- Returns:
DEFAULT
to indicate that the default conversion process should proceed. Any other values (including null) will override the process.
-
-