/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.ObjectInterface#safeget(java.lang.String) */ public PropertyInterface safeget(String name) { return (PropertyInterface) getFields().get(name); }
public String[] getPropertyNames() { return getFields().keySet().toArray(new String[0]); }
public Object[] getProperties() { return getFields().values().toArray(); }
/** * {@inheritDoc} * * @see com.xpn.xwiki.objects.BaseElement#clone() */ @Override public Object clone() { BaseCollection collection = (BaseCollection) super.clone(); collection.setXClassReference(getRelativeXClassReference()); collection.setNumber(getNumber()); Map fields = getFields(); Map cfields = new HashMap(); for (Object objEntry : fields.entrySet()) { Map.Entry entry = (Map.Entry) objEntry; PropertyInterface prop = (PropertyInterface) ((BaseElement) entry.getValue()).clone(); prop.setObject(collection); cfields.put(entry.getKey(), prop); } collection.setFields(cfields); return collection; }
BaseCollection oldCollection = (BaseCollection) oldObject; for (Object key : this.getFields().keySet()) { String propertyName = (String) key; BaseProperty newProperty = (BaseProperty) this.getFields().get(propertyName); BaseProperty oldProperty = (BaseProperty) oldCollection.getFields().get(propertyName); BaseClass bclass = getXClass(context); PropertyClass pclass = (PropertyClass) ((bclass == null) ? null : bclass.getField(propertyName)); for (Object key : oldCollection.getFields().keySet()) { String propertyName = (String) key; BaseProperty newProperty = (BaseProperty) this.getFields().get(propertyName); BaseProperty oldProperty = (BaseProperty) oldCollection.getFields().get(propertyName); BaseClass bclass = getXClass(context); PropertyClass pclass = (PropertyClass) ((bclass == null) ? null : bclass.getField(propertyName));