use of org.springframework.cglib.core.ProcessSwitchCallback in project spring-framework by spring-projects.
the class Enhancer method emitSetCallback.
private void emitSetCallback(ClassEmitter ce, int[] keys) {
final CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, SET_CALLBACK, null);
e.load_arg(0);
e.process_switch(keys, new ProcessSwitchCallback() {
public void processCase(int key, Label end) {
e.load_this();
e.load_arg(1);
e.checkcast(callbackTypes[key]);
e.putfield(getCallbackField(key));
e.goTo(end);
}
public void processDefault() {
// TODO: error?
}
});
e.return_value();
e.end_method();
}
use of org.springframework.cglib.core.ProcessSwitchCallback in project spring-framework by spring-projects.
the class Enhancer method emitGetCallback.
private void emitGetCallback(ClassEmitter ce, int[] keys) {
final CodeEmitter e = ce.begin_method(Constants.ACC_PUBLIC, GET_CALLBACK, null);
e.load_this();
e.invoke_static_this(BIND_CALLBACKS);
e.load_this();
e.load_arg(0);
e.process_switch(keys, new ProcessSwitchCallback() {
public void processCase(int key, Label end) {
e.getfield(getCallbackField(key));
e.goTo(end);
}
public void processDefault() {
// stack height
e.pop();
e.aconst_null();
}
});
e.return_value();
e.end_method();
}
Aggregations