@Override protected Binding createObject(String strippedName, Object obj) { return new Binding(strippedName, obj); } }
@Override protected Binding createObject(String strippedName, Object obj) { return new Binding(strippedName, obj); } }
private ContextNode(final ContextNode parentNode, final String name, final Name fullName, final NamingContext context) { super(fullName, new Binding(getLastComponent(fullName), Context.class.getName(), context)); this.name = name; this.parentNode = parentNode; }
@Override public Object nextElement() { Map.Entry<String, Object> entry = getNext(); return new Binding(entry.getKey(), entry.getValue()); } }
public Object nextElement() { Map.Entry entry = getNext(); return new Binding((String)entry.getKey(), entry.getValue()); } }
Binding binding = new Binding(); GroovyShell shell = new GroovyShell(binding); Object value = shell.evaluate("for (x=0; x<5; x++){println "Hello"}; return x");
// call groovy expressions from Java code Binding binding = new Binding(); binding.setVariable("foo", new Integer(2)); GroovyShell shell = new GroovyShell(binding); Object value = shell.evaluate(groovyScript);
protected Void foundBindContext(final ContextNode contextNode) throws NamingException { final String childName = getLastComponent(targetName); final Binding binding = new Binding(childName, className, object, true); final BindingNode bindingNode = new BindingNode(targetName, binding); contextNode.addChild(childName, bindingNode); fireEvent(contextNode, targetName, null, binding, NamingEvent.OBJECT_ADDED, "bind"); return null; } }
protected Void foundBindContext(final ContextNode contextNode) throws NamingException { final String childName = getLastComponent(targetName); final Binding binding = new Binding(childName, className, object, true); final BindingNode bindingNode = new BindingNode(targetName, binding); final TreeNode previous = contextNode.replaceChild(childName, bindingNode); final Binding previousBinding = previous != null ? previous.binding : null; fireEvent(contextNode, targetName, previousBinding, binding, previousBinding != null ? NamingEvent.OBJECT_CHANGED : NamingEvent.OBJECT_ADDED, "rebind"); return null; } }
public class MyCell : ViewCell { public MyCell() : base() { RelativeLayout layout = new RelativeLayout(); layout.SetBinding( Layout.BackgroundColorProperty, new Binding( "BackgroundColor" ) ); View = Layout; } }
while (iterat.hasNext()) { String bindingName = (String) iterat.next(); bindings.addElement(new Binding(bindingName, ctxMaps.get(bindingName)));
javax.naming.Binding jbndg = new javax.naming.Binding(cnameStr, obj);
prefix.add(relName); final RelativeFederatingContext context = new RelativeFederatingContext(new FastHashtable<String, Object>(remoteContext.getEnvironment()), remoteContext, prefix); results.add(new Binding(relName, context, true)); } else if (b == Protocol.P_BINDING) { results.add(unmarshaller.readObject(Binding.class));
public Object nextElement() { Map.Entry entry = getNext(); return new Binding((String) entry.getKey(), entry.getValue()); } }
public void exec(File file, OutputStream output) throws Exception { Binding binding = new Binding() binding.setProperty("out", new PrintStream(output)) GroovyShell shell = new GroovyShell(binding); shell.evaluate(file); }
public void exec(File file, OutputStream output) throws Exception { Binding binding = new Binding() binding.setProperty("out", output) GroovyShell shell = new GroovyShell(binding); shell.evaluate(file); }
@Override public NamingEnumeration<Binding> listBindings(String name) throws NamingException { if (name == "") { List<Binding> l = new ArrayList<Binding>(); l.add(new Binding("String", "Bar", "")); l.add(new Binding("ArrayList", "Bar", new ArrayList())); return new Bindings(l); } else { throw new NamingException(); } } }
@Override public NamingEnumeration<Binding> listBindings(String name) throws NamingException { if (name.startsWith("java:global") || name == "") { List<Binding> l = new ArrayList<Binding>(); l.add(new Binding("Foo", "Bar", "")); return new Bindings(l); } else { throw new NamingException(); } } }
@Override public NamingEnumeration<Binding> listBindings(String name) throws NamingException { if (name.startsWith("java:global")) { List<Binding> l = new ArrayList<Binding>(); l.add(new Binding("Foo", "Bar", "")); l.add(new Binding("Foo2", "Bar2", new SimpleContext())); return new Bindings(l); } else { throw new NamingException(); } } }