public String toString() { return this.name(); }
public String toString() { String s = this.bean.name() + "(id:" + ID + "-name:" + name + ")" + " ["; // NOI18N for (int i=0; i<this.types.size(); i++) { String t = (String)this.types.get(i); s += " " + t; // NOI18N } return s + "]"; // NOI18N } }
public String toString() { String p, r; if (this.parent != null) p = this.parent.toString(); else p = "-"; // NOI18N if (this.root != null) r = root.name(); else r = "-"; // NOI18N return "Parent:"+p+" Root:"+r; // NOI18N }
public boolean hasName(String name) { if (name != null) return (name.equals(this.name()) || name.equals(this.dtdName())); else return false; }
public String toString() { // BEGIN_NOI18N if (this.root != null) { return "BaseBean(" + this.root.name() + "." + Integer.toHexString(this.root.hashCode()) + ") " + this.name + "[" + ((this.name==null)?"i"+this.index: ""+this.root.idToIndex(this.name, this.index)) + "] - isNode: " + this.isNode(); } else { return "BaseBean(null)"; } } // END_NOI18N }
int getIndex(BaseBean baseBean){ int index = -1; boolean root = isRootElement(baseBean); if(!root){ String name = baseBean.name(); BaseBean parent = baseBean.parent(); if(parent != null) { index = parent.indexOf(name, baseBean); } } return index; }
/** * Add a type to the entry (the type doesn't have to be unique) */ public void addType(BaseBean bean, String type) { if (DDLogFlags.debug) { TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD, DDLogFlags.DBG_REG, 1, DDLogFlags.ADDTYPE, bean.name() + " " + type); } RegEntry se = this.getRegEntry(bean, true); se.add(type); }
public int getCardinal(){ String name = baseBean.name(); BaseBean parent = baseBean.parent(); BaseProperty baseProperty = parent.getProperty(name); return baseProperty.getInstanceType(); }
/** * Create a new entry in the DD graph registry. The schema2beans graph * bean is added to registry using a unique name (ID), such as a unique * internal identifier, and a non unique name (name), * such as a display name. * * Any number of non unique type can also be associated to a graph * entry, see the method addType. * */ public void createEntry(BaseBean bean, String ID, String name) { RegEntry entry = this.getRegEntry(bean, false); if (entry != null) { throw new IllegalArgumentException(Common.getMessage( "BeanGraphAlreadyInRegistry_msg", bean.name())); } entry = this.getRegEntry(ID); if (entry != null) { throw new IllegalArgumentException(Common.getMessage( "CantRegisterGraphSameID_msg", bean.name(), entry, ID)); } bean.addPropertyChangeListener(this.changeTracer); this.scopes.add(new RegEntry(bean, ID, name)); }
/** * Return the entry for the BaseBean, if any. */ RegEntry getRegEntry(BaseBean bean, boolean raise) { for (int i=0; i<this.scopes.size(); i++) { RegEntry se = (RegEntry)this.scopes.get(i); if (se.getBean() == bean) { return se; } } // Didn't find it - try to look for the root if ((bean != null) && !bean.isRoot()) { do { bean = bean.parent(); } while(bean != null && !bean.isRoot()); return this.getRegEntry(bean, raise); } if (raise) { throw new IllegalArgumentException(Common.getMessage( "BeanGraphEntryNotInRegistry_msg", bean.name())); } else return null; }