"addVetoableChangeListener",
ACC_PUBLIC | ACC_SYNTHETIC,
ClassHelper.VOID_TYPE,
new Parameter[]{new Parameter(vclClassNode, "listener")},
ClassNode.EMPTY_ARRAY,
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"addVetoableChangeListener",
new ArgumentListExpression(
new Expression[]{new VariableExpression("listener")})))));
// add method:
// void addVetoableChangeListener(name, listener) {
// this$vetoableChangeSupport.addVetoableChangeListener(name, listener)
// }
declaringClass.addMethod(
new MethodNode(
"addVetoableChangeListener",
ACC_PUBLIC | ACC_SYNTHETIC,
ClassHelper.VOID_TYPE,
new Parameter[]{new Parameter(ClassHelper.STRING_TYPE, "name"), new Parameter(vclClassNode, "listener")},
ClassNode.EMPTY_ARRAY,
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"addVetoableChangeListener",
new ArgumentListExpression(
new Expression[]{new VariableExpression("name"), new VariableExpression("listener")})))));
// add method:
// boolean removeVetoableChangeListener(listener) {
// return this$vetoableChangeSupport.removeVetoableChangeListener(listener);
// }
declaringClass.addMethod(
new MethodNode(
"removeVetoableChangeListener",
ACC_PUBLIC | ACC_SYNTHETIC,
ClassHelper.VOID_TYPE,
new Parameter[]{new Parameter(vclClassNode, "listener")},
ClassNode.EMPTY_ARRAY,
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"removeVetoableChangeListener",
new ArgumentListExpression(
new Expression[]{new VariableExpression("listener")})))));
// add method: void removeVetoableChangeListener(name, listener)
declaringClass.addMethod(
new MethodNode(
"removeVetoableChangeListener",
ACC_PUBLIC | ACC_SYNTHETIC,
ClassHelper.VOID_TYPE,
new Parameter[]{new Parameter(ClassHelper.STRING_TYPE, "name"), new Parameter(vclClassNode, "listener")},
ClassNode.EMPTY_ARRAY,
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"removeVetoableChangeListener",
new ArgumentListExpression(
new Expression[]{new VariableExpression("name"), new VariableExpression("listener")})))));
// add method:
// void fireVetoableChange(String name, Object oldValue, Object newValue)
// throws PropertyVetoException
// {
// this$vetoableChangeSupport.fireVetoableChange(name, oldValue, newValue)
// }
declaringClass.addMethod(
new MethodNode(
"fireVetoableChange",
ACC_PUBLIC | ACC_SYNTHETIC,
ClassHelper.VOID_TYPE,
new Parameter[]{new Parameter(ClassHelper.STRING_TYPE, "name"), new Parameter(ClassHelper.OBJECT_TYPE, "oldValue"), new Parameter(ClassHelper.OBJECT_TYPE, "newValue")},
new ClassNode[] {ClassHelper.make(PropertyVetoException.class)},
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"fireVetoableChange",
new ArgumentListExpression(
new Expression[]{
new VariableExpression("name"),
new VariableExpression("oldValue"),
new VariableExpression("newValue")})))));
// add method:
// VetoableChangeListener[] getVetoableChangeListeners() {
// return this$vetoableChangeSupport.getVetoableChangeListeners
// }
declaringClass.addMethod(
new MethodNode(
"getVetoableChangeListeners",
ACC_PUBLIC | ACC_SYNTHETIC,
vclClassNode.makeArray(),
Parameter.EMPTY_ARRAY,
ClassNode.EMPTY_ARRAY,
new ReturnStatement(
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"getVetoableChangeListeners",
ArgumentListExpression.EMPTY_ARGUMENTS)))));
// add method:
// VetoableChangeListener[] getVetoableChangeListeners(String name) {
// return this$vetoableChangeSupport.getVetoableChangeListeners(name)
// }
declaringClass.addMethod(
new MethodNode(
"getVetoableChangeListeners",
ACC_PUBLIC | ACC_SYNTHETIC,
vclClassNode.makeArray(),
new Parameter[]{new Parameter(ClassHelper.STRING_TYPE, "name")},
ClassNode.EMPTY_ARRAY,
new ReturnStatement(
new ExpressionStatement(
new MethodCallExpression(
new FieldExpression(vcsField),
"getVetoableChangeListeners",
new ArgumentListExpression(
new Expression[]{new VariableExpression("name")}))))));