01: /**
02: * Objective Database Abstraction Layer (ODAL)
03: * Copyright (c) 2004, The ODAL Development Group
04: * All rights reserved.
05: * For definition of the ODAL Development Group please refer to LICENCE.txt file
06: *
07: * Distributable under LGPL license.
08: * See terms of license at gnu.org.
09: */package com.completex.objective.components.persistency.meta;
10:
11: import java.util.LinkedHashMap;
12: import java.util.List;
13: import java.util.Map;
14:
15: /**
16: * @author Gennady Krizhevsky
17: */
18: public class MetaMultipleResultFactory {
19: private String className;
20: private List constructorArgs;
21: public static final String TAG_CLASS_NAME = "className";
22: public static final String TAG_CONSTRUCTOR_ARGS = "constructorArgs";
23:
24: public MetaMultipleResultFactory() {
25: }
26:
27: public MetaMultipleResultFactory(String className) {
28: this .className = className;
29: }
30:
31: public MetaMultipleResultFactory(Map map) {
32: fromMap(map);
33: }
34:
35: public String getClassName() {
36: return className;
37: }
38:
39: public void setClassName(String className) {
40: this .className = className;
41: }
42:
43: public List getConstructorArgs() {
44: return constructorArgs;
45: }
46:
47: public void setConstructorArgs(List constructorArgs) {
48: this .constructorArgs = constructorArgs;
49: }
50:
51: public Map toMap() {
52: LinkedHashMap map = new LinkedHashMap();
53: map.put(TAG_CLASS_NAME, className);
54: map.put(TAG_CONSTRUCTOR_ARGS, constructorArgs);
55:
56: return map;
57: }
58:
59: public void fromMap(Map map) {
60: className = (String) map.get(TAG_CLASS_NAME);
61: constructorArgs = (List) map.get(TAG_CONSTRUCTOR_ARGS);
62: }
63:
64: }
|