/** * Performs injection to the given object. */ /*package*/ void inject(Dom dom, Object target) { try { ServiceLocatorUtilities.<ConfigInjector>getService(locator, injector).inject(dom,target); } catch (ConfigurationException e) { e.setLocation(dom.getLocation()); throw e; } }
/** * Updates the attribute value. * * This would trigger the re-injection of the value. */ public void attribute(String name, String value) { if (value==null) { attributes.remove(name); } else { attributes.put(name,value); // TODO: // this re-injection has two problems. First, it forces an instantiation // even if that hasn't happened yet. Second, if the component is scoped, // this won't work correctly (but then, there's no way to make that work, // since we can't enumerate all scope instances.) getInjector().injectAttribute(this,name,get()); } }
/** * Updates leaf-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setLeafElements(final String name, String... values) { List<Child> newChildren = new ArrayList<Child>(children); LeafChild[] leaves = new LeafChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new LeafChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Updates node-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setNodeElements(final String name, Dom... values) { List<Child> newChildren = new ArrayList<Child>(children); NodeChild[] leaves = new NodeChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new NodeChild(name,values[i]); List<Child> removed = stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; for (Child c : removed) { ((NodeChild) c).dom.release(); } // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Performs injection to the given object. */ /*package*/ void inject(Dom dom, Object target) { try { injector.get().inject(dom,target); } catch (ConfigurationException e) { e.setLocation(dom.getLocation()); throw e; } }
/** * Updates the attribute value. * * This would trigger the re-injection of the value. */ public void attribute(String name, String value) { if (value==null) { attributes.remove(name); } else { attributes.put(name,value); // TODO: // this re-injection has two problems. First, it forces an instantiation // even if that hasn't happened yet. Second, if the component is scoped, // this won't work correctly (but then, there's no way to make that work, // since we can't enumerate all scope instances.) getInjector().injectAttribute(this,name,get()); } }
/** * Updates leaf-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setLeafElements(final String name, String... values) { List<Child> newChildren = new ArrayList<Child>(children); LeafChild[] leaves = new LeafChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new LeafChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Performs injection to the given object. */ /*package*/ void inject(Dom dom, Object target) { try { ServiceLocatorUtilities.<ConfigInjector>getService(locator, injector).inject(dom,target); } catch (ConfigurationException e) { e.setLocation(dom.getLocation()); throw e; } }
/** * Updates the attribute value. * * This would trigger the re-injection of the value. */ public void attribute(String name, String value) { if (value==null) { attributes.remove(name); } else { attributes.put(name,value); // TODO: // this re-injection has two problems. First, it forces an instantiation // even if that hasn't happened yet. Second, if the component is scoped, // this won't work correctly (but then, there's no way to make that work, // since we can't enumerate all scope instances.) getInjector().injectAttribute(this,name,get()); } }
/** * Updates leaf-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setLeafElements(final String name, String... values) { List<Child> newChildren = new ArrayList<Child>(children); LeafChild[] leaves = new LeafChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new LeafChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Performs injection to the given object. */ /*package*/ void inject(Dom dom, Object target) { try { injector.get().inject(dom,target); } catch (ConfigurationException e) { e.setLocation(dom.getLocation()); throw e; } }
/** * Updates the attribute value. * * This would trigger the re-injection of the value. */ public void attribute(String name, String value) { if (value==null) { attributes.remove(name); } else { attributes.put(name,value); // TODO: // this re-injection has two problems. First, it forces an instantiation // even if that hasn't happened yet. Second, if the component is scoped, // this won't work correctly (but then, there's no way to make that work, // since we can't enumerate all scope instances.) getInjector().injectAttribute(this,name,get()); } }
/** * Updates node-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setNodeElements(final String name, Dom... values) { List<Child> newChildren = new ArrayList<Child>(children); NodeChild[] leaves = new NodeChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new NodeChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Performs injection to the given object. */ /*package*/ void inject(Dom dom, Object target) { try { ServiceLocatorUtilities.<ConfigInjector>getService(locator, injector).inject(dom,target); } catch (ConfigurationException e) { e.setLocation(dom.getLocation()); throw e; } }
/** * Updates the attribute value. * * This would trigger the re-injection of the value. */ public void attribute(String name, String value) { if (value==null) { attributes.remove(name); } else { attributes.put(name,value); // TODO: // this re-injection has two problems. First, it forces an instantiation // even if that hasn't happened yet. Second, if the component is scoped, // this won't work correctly (but then, there's no way to make that work, // since we can't enumerate all scope instances.) getInjector().injectAttribute(this,name,get()); } }
/** * Updates leaf-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setLeafElements(final String name, String... values) { List<Child> newChildren = new ArrayList<Child>(children); LeafChild[] leaves = new LeafChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new LeafChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Updates leaf-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setLeafElements(final String name, String... values) { List<Child> newChildren = new ArrayList<Child>(children); LeafChild[] leaves = new LeafChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new LeafChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Updates node-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setNodeElements(final String name, Dom... values) { List<Child> newChildren = new ArrayList<Child>(children); NodeChild[] leaves = new NodeChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new NodeChild(name,values[i]); stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Updates node-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setNodeElements(final String name, Dom... values) { List<Child> newChildren = new ArrayList<Child>(children); NodeChild[] leaves = new NodeChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new NodeChild(name,values[i]); List<Child> removed = stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; for (Child c : removed) { ((NodeChild) c).dom.release(); } // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }
/** * Updates node-element values. * <p> * Synchronized so that concurrenct modifications will work correctly. */ public synchronized void setNodeElements(final String name, Dom... values) { List<Child> newChildren = new ArrayList<Child>(children); NodeChild[] leaves = new NodeChild[values.length]; for (int i = 0; i < values.length; i++) leaves[i] = new NodeChild(name,values[i]); List<Child> removed = stitchList(newChildren,name,Arrays.asList(leaves)); children = newChildren; for (Child c : removed) { ((NodeChild) c).dom.release(); } // see attribute(String,String) for the issue with this getInjector().injectElement(this,name,get()); }