KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > kohsuke > stapler > jelly > groovy > JellyBinding


1 package org.kohsuke.stapler.jelly.groovy;
2
3 import groovy.lang.Binding;
4 import org.apache.commons.jelly.JellyContext;
5 import org.apache.commons.jelly.XMLOutput;
6
7 /**
8  * {@link Binding} that delegates to {@link JellyContext}.
9  *
10  * @author Kohsuke Kawaguchi
11  */

12 public class JellyBinding extends Binding {
13     private final JellyContext context;
14
15     private final XMLOutput out;
16
17     public JellyBinding(JellyContext context, XMLOutput out) {
18         this.context = context;
19         this.out = out;
20         setProperty("output",out);
21     }
22
23     public Object JavaDoc getVariable(String JavaDoc name) {
24         return context.getVariable(name);
25     }
26
27     public void setVariable(String JavaDoc name, Object JavaDoc value) {
28         context.setVariable(name,value);
29     }
30 }
31
Popular Tags