@Override String elementValue(Object element) { return Dom.unwrap((ConfigBeanProxy) element).getKey(); } }
@Override public void set(Dom dom, Object arg) { Dom target = (Dom) arg; dom.attribute(xmlName, arg==null?null:target.getKey()); } }
/** * Recursively decends the DOM tree and finds a DOM that has the given key * and the type name. * * <p> * TODO: the current algorithm does a full tree scan. Expand the model * so that we can detect deadends that are statically known not to contain * the kind we are looking for, and use that to cut the search space. */ public Dom resolveReference(String key, String typeName) { String keyedAs = model.keyedAs; if(keyedAs!=null && keyedAs.equals(typeName) && getKey().equals(key)) return this; // found it for (Child child : children) { if (child instanceof NodeChild) { NodeChild n = (NodeChild) child; Dom found = n.dom.resolveReference(key,typeName); if(found!=null) return found; } } return null; }
/** * Replaces an existing {@link NodeChild} with another one. * * @see #insertAfter(Dom, String, Dom) */ public synchronized void replaceChild(Dom reference, String name, Dom newNode) { ListIterator<Child> itr = children.listIterator(); while(itr.hasNext()) { Child child = itr.next(); if (child instanceof NodeChild) { NodeChild nc = (NodeChild) child; if(nc.dom==reference) { reference.release(); newNode.domDescriptor = addWithAlias(getHabitat(), newNode,newNode.getProxyType(), newNode.getKey()); itr.set(new NodeChild(name,newNode)); return; } } } throw new IllegalArgumentException(reference+" is not a valid child of "+this+". Children="+children); }
@Override public void set(Dom dom, Object arg) { if(arg==null) { dom.removeLeafElement(xmlName, dom.leafElement(xmlName)); } else { dom.setLeafElements(xmlName,((Dom) arg).getKey()); } } }
throw new IllegalArgumentException("A " + master.getProxyType().getSimpleName() + " with the same key \"" + keyValue + "\" already exists in " + parent.getProxyType().getSimpleName() + " " + parent.getKey()) ;
throw new PropertyVetoException("Instance of " + getImplementation() + " named '" + getKey() + "' is not locked for writing when invoking method " + method.getName() + " you must use transaction semantics to access it.", null);
String siblingKey = sibling.getKey(); if (newValue.equals(siblingKey)) { bean.getLock().unlock();
domDescriptor = dc.addActiveDescriptor(domDesc, false); String key = getKey(); for (String contract : model.contracts) { ActiveDescriptor<Dom> alias = new AliasDescriptor<Dom>(locator, domDescriptor, contract, key);
@Override public void set(Dom dom, Object arg) { Dom target = (Dom) arg; dom.attribute(xmlName, arg==null?null:target.getKey()); } }
@Override String elementValue(Object element) { return Dom.unwrap((ConfigBeanProxy) element).getKey(); } }
@Override public void set(Dom dom, Object arg) { Dom target = (Dom) arg; dom.attribute(xmlName, arg==null?null:target.getKey()); } }
@Override public void set(Dom dom, Object arg) { Dom target = (Dom) arg; dom.attribute(xmlName, arg==null?null:target.getKey()); } }
@Override String elementValue(Object element) { return Dom.unwrap((ConfigBeanProxy) element).getKey(); } }
@Override String elementValue(Object element) { return Dom.unwrap((ConfigBeanProxy) element).getKey(); } }
@Override public void set(Dom dom, Object arg) { if(arg==null) { dom.removeLeafElement(xmlName, dom.leafElement(xmlName)); } else { dom.setLeafElements(xmlName,((Dom) arg).getKey()); } } }
@Override public void set(Dom dom, Object arg) { if(arg==null) { dom.removeLeafElement(xmlName, dom.leafElement(xmlName)); } else { dom.setLeafElements(xmlName,((Dom) arg).getKey()); } } }
/* package */ void register() { habitat.add(this); String key = getKey(); for (String contract : model.contracts) { habitat.addIndex(this, contract, key); } if (key!=null) { habitat.addIndex(this, model.targetTypeName, key); } }
/* package */ void register() { habitat.add(this); String key = getKey(); for (String contract : model.contracts) { habitat.addIndex(this, contract, key); } if (key!=null) { habitat.addIndex(this, model.targetTypeName, key); } }