1 64 65 package com.jcorporate.expresso.core.misc; 66 67 import java.io.IOException ; 68 import java.io.ObjectInputStream ; 69 import java.io.ObjectOutputStream ; 70 import java.io.Serializable ; 71 import java.util.HashMap ; 72 import java.util.Map ; 73 74 75 80 81 85 public class ConfigClassHandler 86 implements Serializable { 87 private Map parameters = null; 88 89 92 private String name; 93 94 98 private String classHandler; 99 100 public ConfigClassHandler() { 101 } 102 103 106 private void readObject(ObjectInputStream ois) 107 throws ClassNotFoundException , IOException { 108 ois.defaultReadObject(); 109 } 110 111 114 private void writeObject(ObjectOutputStream oos) 115 throws IOException { 116 oos.defaultWriteObject(); 117 } 118 119 public void setName(String newName) { 120 name = newName; 121 } 122 123 public String getName() { 124 return name; 125 } 126 127 public void setClassHandler(String newClassHandler) { 128 classHandler = newClassHandler; 129 } 130 131 public String getClassHandler() { 132 return classHandler; 133 } 134 135 138 public synchronized void addParameter(ConfigClassHandlerParameter param) { 139 if (parameters == null) { 140 parameters = new HashMap (); 141 } 142 143 parameters.put(param.getParamName(), param.getParamValue()); 144 } 145 146 149 public String getParameter(String parameterName) { 150 if (parameters == null) { 151 return null; 152 } 153 154 return (String ) parameters.get(parameterName); 155 } 156 } | Popular Tags |