/** * This listener runs after jaxb unmarshalling and reconnects children properties to their parent list (as we don't * send them avoiding cyclic references). */ public void afterUnmarshal(Object u, Object parent) { for (Property p : this.list) { p.setParentList(this); } } }
/** * Adds a child property to the end of this list. This method also sets the * {@link Property#setParentList(PropertyList) parent list} for the child property to make persistence work. * * @param property the property to add to this list */ public void add(@NotNull Property property) { if (this.memberPropertyName == null) { this.memberPropertyName = property.getName(); } if (!property.getName().equals(this.memberPropertyName)) { throw new IllegalStateException("All properties in a PropertyList (id=[" + getId() + "], name=[" + getName() + "]) must have the same name: [" + property.getName() + "] != [" + this.memberPropertyName + "]"); } getList().add(property); property.setParentList(this); }