01: package com.jat.integration;
02:
03: import java.util.Properties;
04:
05: import com.jat.core.config.Config;
06: import com.jat.core.log.LogManager;
07:
08: /**
09: * <p>Title: JAT</p>
10: * <p>Description: This class represent a configured field of Data Source operation</p>
11: * <p>Copyright: Copyright (c) 2004 -2005 Stefano Fratini (stefano.fratini@gmail.com)</p>
12: * <p>Distributed under the terms of the GNU Lesser General Public License, v2.1 or later</p>
13: * @author stf
14: * @version 1.0
15: * @since 1.2
16: * @see com.jat.integration.GenericDataSource
17: * @see com.jat.integration.GenericOperationDefinition
18: */
19:
20: public abstract class GenericFieldDefinition {
21:
22: /**
23: * Get further properties of the field
24: * @return properties
25: */
26: public final Properties getProperties() {
27: return properties;
28: }
29:
30: public final void setProperties(Properties properties) {
31: this .properties = properties;
32: }
33:
34: /**
35: * The configured field name
36: */
37: public static final String CONFIG_NAME = ".name";
38: /**
39: * The configured field key
40: */
41: public static final String CONFIG_FIELD = ".field";
42:
43: /**
44: * This method initialize the configured field
45: * @param section the section into config file
46: * @param key the key into config file used to load field
47: * @param operationName the operation name of the field
48: * @throws IntegrationException if any exception occours
49: */
50: protected void init(String section, String key, String operationName)
51: throws IntegrationException {
52: try {
53: // set name
54: this .setName(Config.getCurrent().getValue(section,
55: key + CONFIG_NAME));
56: LogManager.sendDebug(this .getClass().getName() + "::init: "
57: + section + "/" + operationName + "/Name = "
58: + this .name);
59: } catch (Exception ex) {
60: throw new IntegrationException(this .getClass().getName()
61: + "::initFileds: exception: " + ex);
62: }
63: }
64:
65: /**
66: * Get the field name
67: * @return the field name
68: */
69: public String getName() {
70: return this .name;
71: }
72:
73: public void setName(String name) {
74: this .name = name;
75: }
76:
77: public String toString() {
78: return this .getName();
79: }
80:
81: private String name;
82: private Properties properties = new Properties();
83: }
|