From 24314dc1699c7e73048fa24e33729f1aa1ec0e86 Mon Sep 17 00:00:00 2001 From: Andrew Branson Date: Fri, 6 Jul 2012 11:00:24 +0200 Subject: Modules serialize with Castor. Just about to remove the parsing. CastorXMLUtility is now a static member of gateway. Domain specific instances can be used by domain applications, but the maps do not interfere with the kernel. --- .../java/com/c2kernel/property/PropertyArrayList.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main/java/com/c2kernel/property/PropertyArrayList.java') diff --git a/src/main/java/com/c2kernel/property/PropertyArrayList.java b/src/main/java/com/c2kernel/property/PropertyArrayList.java index f59b2d5..5401f22 100644 --- a/src/main/java/com/c2kernel/property/PropertyArrayList.java +++ b/src/main/java/com/c2kernel/property/PropertyArrayList.java @@ -22,8 +22,21 @@ public class PropertyArrayList extends CastorArrayList public PropertyArrayList(ArrayList aList) { - super(aList); + super(); + // put all properties in order, so later ones with the same name overwrite earlier ones + for (Property property : aList) { + put(property); + } } - + /** Overwrite */ + public void put(Property p) { + for (Property thisProp : list) { + if (thisProp.getName().equals(p.getName())) { + list.remove(thisProp); + break; + } + } + list.add(p); + } } -- cgit v1.2.3