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