public boolean isIndexed() { return Common.isArray(this.type); }
/** * If the property is an indexed property, return all the values * as an array of its type. */ public Object[] getValues() { if (!Common.isArray(this.type)) throw new IllegalStateException(Common. getMessage("NotIndexedProperty_msg")); return this.getObjectArray(0); }
String buildFullName(int index, String attr) { StringBuffer name = new StringBuffer(); if (!Common.isArray(this.type)) { // Value not set for single type property - return null if ((index > 0) || (this.bindingsSize() == 0)) return null; } DOMBinding b = (DOMBinding)this.bindings.get(index); if (b != null) { if (attr != null) { name.append(":"); // NOI18N name.append(attr); } this.buildPathName(b, name); } else return null; return name.toString(); }
private void checkParams(int index, Object value, boolean add) { if (add) { if (value == null) throw new IllegalArgumentException(Common. getMessage("CannotAddNullValue_msg")); } else { if (!Common.isArray(this.type)) { if (index > 0) throw new IllegalArgumentException(Common. getMessage("InvalidIndexForTypeProperty_msg")); } else { if ((index < 0) || (index >= this.bindingsSize())) throw new IndexOutOfBoundsException(); } } }
public Object getValue(int index) { if (!Common.isArray(this.type)) { // Value not set for single type property - return null if ((index > 0) || (this.bindingsSize() == 0)) return null; } if (bindingsSize() == 0) { // Ok no value set so far. return null. return null; } // end of if (this.bindingsSize() == 0) DOMBinding b = (DOMBinding)this.bindings.get(index); if (b != null) return b.getValue(this); else return null; }
return; if (Common.isArray(this.type)) { DOMBinding b = null; int size = this.bindingsSize();
/** * Get the attribute value */ public String getAttributeValue(int index, String name) { String ret = null; AttrProp ap = this.getAttrProp(name); if (!Common.isArray(this.type)) { // Value not set for single type property - return null if ((index > 0) || (this.bindingsSize() == 0)) return null; } DOMBinding b = (DOMBinding)this.bindings.get(index); if (b != null) ret = b.getAttributeValue(this, ap.getDtdName()); if (DDLogFlags.debug) { TraceLogger.put(TraceLogger.DEBUG, TraceLogger.SVC_DD, DDLogFlags.DBG_BLD, 10, DDLogFlags.GETATTR, this.beanName + "[" + index + "]." + ap.getDtdName() + ": " + ret + " " + ((b==null)?"<no binding>":("B("+b.hashCode()+")"))+ " BP(" + this.hashCode() + ")"); } return ret; }
/** * Get the bean using its unique identifier. This identifier is not * the indexed position of the element in the array but a unique id * associated to the DOMBinding object (see the BeanProp and DOMBinding * classes) */ public Bean propertyById(String name, int id) { BeanProp bp = this.beanProp(name); if (Common.isBean(bp.type)) { if (Common.isArray(bp.type)) return (BaseBean)bp.getValueById(id); else return (BaseBean)bp.getValue(0); } else throw new IllegalStateException(Common. getMessage("PropertyIsNotABean_msg", name)); }
if (!Common.isArray(matchingProp.type)) { Iterator propIt = (Iterator) dupDtdNameIterators.get(eltName);
/** * Returns the position of the indexed property element. * If the type of the property is a bean, use the == comparison, * else use the equals() method. * If the element is not found, return -1. */ public int indexOf(String name, Object value) throws Schema2BeansRuntimeException { BeanProp bp = this.beanProp(name); if (bp == null) throw new Schema2BeansRuntimeException(Common. getMessage("UnknownPropertyName_msg", name)); if (Common.isArray(bp.type)) { boolean isBean = Common.isBean(bp.type); int size = bp.size(); for (int i=0; i<size; i++) { Object obj = bp.getValue(i); if (isBean && (obj == value)) return i; else if (!isBean && (obj.equals(value))) return i; } } return -1; }
if (Common.isArray(this.type)) { Object []arrValue;
protected void copyProperty(BeanProp prop, BaseBean bean, int index, Object value) { boolean isArray = Common.isArray(prop.type); String name = prop.getName(); // Copy the property value if (value == null) { if (isArray) value = bean.getValue(name, index); else value = bean.getValue(name, 0); } int newIndex = 0; if (isArray) { newIndex = addValue(prop, value); } else { setValue(prop, 0, value); index = 0; } this.copyAttributes(prop, newIndex, bean, index); }
boolean isArray = Common.isArray(prop.type); boolean isBean = Common.isBean(prop.type); Object o1, o2, o3;
if (Common.isArray(bp.type)) {
if (count==0 || Common.isArray(this.type)) {
boolean isArray = Common.isArray(prop.type); boolean isBean = Common.isBean(prop.type); boolean isKey = Common.isKey(prop.type) || !useKeys;
if (Common.isArray(prop.type)) { int size = prop.size(); if (Common.isBean(prop.type)) {