void resolveGraph(String path) { String pathRoot = null; if (PathResolver.needResolving(path)) path = (new PathResolver(this.parent, path)).toString(); int idx = path.indexOf(':'); if (idx != -1) { pathRoot = path.substring(idx+1); path = path.substring(0, idx); } BaseBean[] beans = this.registry.getRoots(path); if (beans.length > 0) { this.root = beans[0]; if (pathRoot != null) { DDCursor cur = new DDRegistryParser.DDCursor(this, pathRoot); this.root = cur.getRoot(); } } }
public DDCursor getCursor() { Object o = this.current(); if (o instanceof BaseBean) { BaseBean b = (BaseBean)o; if (b == null && this.hasNext()) b = (BaseBean)this.next(); if (b != null) return new DDCursor(this.registry, b); } else { // Return our parent cursor or build a new one DDCursor cur = this.parser.getParentCursor(); if (cur == null) { BaseBean[] beans = this.parser.getRoots(); cur = new DDCursor(this.registry, beans[0]); } return cur; } return null; }
public Object getValue(String ddName) { BaseBean b = (BaseBean)this.current(); if (b == null && this.hasNext()) b = (BaseBean)this.next(); if (b != null) { // This will seach for the ddName element in the current // graph and will also search in the ParentCursor graph // if the element is not found DDCursor cur = new DDCursor(this.parser.getParentCursor(), b); PathResolver p = new PathResolver(); Object obj = p.resolvePathVar(cur, ddName); return obj; } return null; }
/** * Create a cursor location */ public DDRegistryParser.DDCursor newCursor(DDRegistryParser.DDCursor c, String path) { return new DDRegistryParser.DDCursor(c, path); }
/** * Create a cursor location */ public DDRegistryParser.DDCursor newCursor(String path) { return new DDRegistryParser.DDCursor(this, path); }
/** * Create a cursor location */ public DDRegistryParser.DDCursor newCursor(BaseBean bean) { return new DDRegistryParser.DDCursor(this, bean); }