public boolean hasGraph(String str, DDRegistryParser.DDCursor c) { String s = getGraphName(str); if (s != null) { if (!s.equals(DDRegistryParser.CURRENT_CURSOR)) return (this.getRoot(s) != null); else { if (c == null) return true; else return (this.getID(c) != null); } } return false; }
public void remove(BaseBean b) { RegEntry re = this.reg.getRegEntry(b, false); if (re != null) this.elts.remove(re); }
/** * Return the bean root for this name (either unique name or scope) */ public BaseBean getRoot(String s) { BaseBean[] r = this.getRoots(s); if (r.length>0) return r[0]; return null; }
/** * Remove a registry entry. */ public void removeEntry(String ID) { RegEntry entry = this.getRegEntry(ID); if (entry != null) entry.getBean().removePropertyChangeListener(this.changeTracer); this.removeRegEntry(entry); }
/** * Return all the bean roots for this name (either unique name or scope) */ public BaseBean[] getRoots(String s) { s = getGraphName(s); // Try to get the root by name, then by type RegEntry se = this.getRegEntry(s); if (se == null) { ArrayList list = new ArrayList(); for (int i=0; i<this.scopes.size(); i++) { se = (RegEntry)this.scopes.get(i); if (se.hasType(s)) list.add(se.getBean()); } BaseBean[] ret = new BaseBean[list.size()]; return (BaseBean[])list.toArray(ret); } else return (new BaseBean[] {se.getBean()}); }
/** * Reset the change timestamp of the specified graph. */ public void clearCache(BaseBean bean) { this.setTimestamp(bean); }
/** * Rename a graph unique ID to a new unique ID. */ public void renameEntry(String oldID, String newID) { this.renameEntry(oldID, newID, null); }
public boolean hasGraph(String str) { return this.hasGraph(str, null); }
/** * Remove an entry in the registry. */ public void removeEntry(BaseBean bean) { RegEntry entry = this.getRegEntry(bean, false); if (entry != null) { entry.getBean().removePropertyChangeListener(this.changeTracer); this.removeRegEntry(entry); } }
/** * Add a graph to the marker list. If any change occurs in this graph * after resetMarker() is called, hasChanged() would return true. */ public void add(BaseBean b) { RegEntry re = this.reg.getRegEntry(b, false); if (re != null && !this.elts.contains(re)) { this.elts.add(re); } }
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 void propertyChange(PropertyChangeEvent e) { try { BaseBean s = (BaseBean)e.getSource(); RegEntry re = this.reg.getRegEntry(s, false); re.setTimestamp(); //String trc = // s.graphManager().getKeyPropertyName(e.getPropertyName()); //re.setLastEvent(trc); } catch(Exception ex) { } } }
BaseBean[] beans = this.registry.getRoots(graphName); this.parser = new ParserSet(beans, null, parsingPath); this.parser.setRoot();
/** * Return true of the specified schema2beans graph is registered with the * specified type. */ public boolean hasType(BaseBean bean, String type) { RegEntry r = this.getRegEntry(bean, false); if (r != null) return r.hasType(type); return false; }
public long getTimestamp(BaseBean bean) { RegEntry r = this.getRegEntry(bean, false); if (r != null) return r.getTimestamp(); return 0L; }
/** * Return the name of the unique graph ID */ public String getName(String ID) { RegEntry r = this.getRegEntry(ID); if (r!= null) return r.getName(); return null; }
public void setTimestamp(BaseBean bean) { RegEntry r = this.getRegEntry(bean, false); if (r != null) r.setTimestamp(); }