01: /*
02: * JFolder, Copyright 2001-2006 Gary Steinmetz
03: *
04: * Distributable under LGPL license.
05: * See terms of license at gnu.org.
06: */
07:
08: package org.jfolder.common.entity.properties;
09:
10: //base classes
11:
12: //project specific classes
13: import org.jfolder.common.entity.SystemEntity;
14:
15: //other classes
16:
17: public class SystemEntityPropertiesHelper {
18:
19: private SystemEntityPropertiesHelper() {
20: }
21:
22: public final static void copyTo(SystemEntityProperties inSource,
23: SystemEntityProperties inDest) {
24:
25: //
26: for (int i = (inDest.getPropertyCount() - 1); i >= 0; i--) {
27: String nextPropName = inDest.getPropertyName(i);
28: inDest.removeProperty(nextPropName);
29: }
30: //
31: for (int i = 0; i < inSource.getPropertyCount(); i++) {
32: String nextPropName = inSource.getPropertyName(i);
33: String nextPropValue = inSource.getPropertyValue(i);
34: inDest.createProperty(nextPropName, nextPropValue);
35: }
36: //
37: inDest.setDocument(inSource.getDocument());
38: }
39: }
|