static class AjaxPollHandlerMetaRule extends MetaRule {
public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) {
if (meta.isTargetInstanceOf(AbstractPoll.class)) {
if ("action".equals(name)) {
return new MethodMetadata(attribute) {
public void applyMetadata(FaceletContext ctx, Object instance) {
((AbstractPoll) instance).setActionExpression(getMethodExpression(ctx));
}
};
}
if ("actionExpression".equals(name)) {
return new MethodMetadata(attribute) {
public void applyMetadata(FaceletContext ctx, Object instance) {
((AbstractPoll) instance).setActionExpression(getMethodExpression(ctx));
}
};
}
if ("actionListener".equals(name)) {
return new MethodMetadata(attribute, ActionEvent.class) {
public void applyMetadata(FaceletContext ctx, Object instance) {
ActionListener actionListener = new MethodExpressionActionListener(getMethodExpression(ctx));
((AbstractPoll) instance).addActionListener(actionListener);
}
};