1 18 19 package sync4j.syncclient.sps.jdbc; 20 21 import java.util.Hashtable ; 22 23 import sync4j.syncclient.sps.common.*; 24 25 26 32 public class FieldMetadataImpl extends FieldMetadata { 33 34 36 public FieldMetadataImpl(String fieldName, String fieldType, Hashtable fieldAttributes) throws DatabaseException{ 37 super(fieldName, fieldType, fieldAttributes); 38 } 39 40 int size = 0; 41 42 51 public boolean validateAttributes(String fieldName, String fieldType, Hashtable fieldAttributes) { 52 53 boolean test = true; 54 55 if (!(fieldName != null) || !(fieldType != null) || !(fieldAttributes.get("size") != null)) { 56 test = false; 57 } 58 59 if ((fieldType != "String") && (fieldType != "Int")) { 60 test = false; 61 } 62 63 try { 64 size = Integer.parseInt((String ) fieldAttributes.get("size")); 65 } catch (NumberFormatException e) { 66 test = false; 67 } 68 69 return test; 70 71 } 72 73 } | Popular Tags |