public int compare(Bean b1, Bean b2){ return b1.getProperty( "id" ).compareTo( b2.getProperty( "id" ) ); }
/** * Return the root of the graph. If the graph is not connected to a * generated root, then the topmost bean is returned. */ public Bean _getRoot() { Bean b = this; Bean bParent; while (!b.isRoot()) { bParent = b._getParent(); if (bParent == null) break; b = bParent; } return b; }
if (theRoot.hasName(beanName)) { curBean = theRoot; } else { if (curBean.getProperty(beanName).isBean()) { curBean = curBean.propertyById(beanName, Integer.parseInt(indexName, 16)); keyPropName.append(key[i]); keyPropName.append("="); // NOI18N String v = (String)curBean.getValue(key[i], 0); if (v != null) keyPropName.append(v); BaseProperty[] l = curBean.listProperties(); for (i=0; i<l.length; i++) { String n = l[i].getName(); keyPropName.append(n); keyPropName.append("="); // NOI18N String v = (String)curBean.getValue(n, 0); if (v != null) keyPropName.append(v);
curBean = curBean.propertyById(beanName, index); if (curBean == null) { throw new IllegalStateException(
public static int getPropertyIndex(Bean theRoot, String name) { String index = extractPropertyIndex(name); if (index != null) { int i = index.lastIndexOf('i'); if (i != -1) { // This is a removed property - return the old value return Integer.parseInt(index.substring(i+1)); } else { // Get the current index value Bean bean = getPropertyParent(theRoot, name); if (bean != null) { BeanProp bp = bean.beanProp(getPropertyName(name)); if (bp != null) return bp.idToIndex(Integer.parseInt(index, 16)); } } } return -1; }