1 21 22 package org.apache.derby.client.am; 23 24 import java.util.Properties ; 25 import java.util.Enumeration ; 26 import java.util.Map ; 27 import java.util.HashMap ; 28 import java.sql.SQLClientInfoException ; 29 import java.sql.ClientInfoStatus ; 30 31 40 public class FailedProperties40 { 41 private final HashMap <String ,ClientInfoStatus > failedProps_ = 42 new HashMap <String ,ClientInfoStatus >(); 43 44 private final String firstKey_; 45 private final String firstValue_; 46 47 54 public static Properties makeProperties(String name, String value) { 55 Properties p = new Properties (); 56 if (name != null || value != null) 57 p.setProperty(name, value); 58 return p; 59 } 60 61 70 public FailedProperties40(Properties props) { 71 if (props == null || props.isEmpty()) { 72 firstKey_ = null; 73 firstValue_ = null; 74 return; 75 } 76 Enumeration e = props.keys(); 77 firstKey_ = (String )e.nextElement(); 78 firstValue_ = props.getProperty(firstKey_); 79 failedProps_.put(firstKey_, ClientInfoStatus.REASON_UNKNOWN_PROPERTY); 80 while (e.hasMoreElements()) { 81 failedProps_.put((String )e.nextElement(), 82 ClientInfoStatus.REASON_UNKNOWN_PROPERTY); 83 } 84 } 85 86 95 public Map <String ,ClientInfoStatus > getProperties() { return failedProps_; } 96 97 104 public String getFirstKey() { return firstKey_; } 105 106 113 public String getFirstValue() { return firstValue_; } 114 } 115 | Popular Tags |