1 25 26 27 package org.objectweb.jonas_ejb.deployment.api; 28 29 34 public class FieldDesc { 35 36 protected String fieldName = null; 37 protected boolean pkField = false; 38 protected Class fieldType = null; 39 40 41 45 public boolean isPrimaryKey() { 46 return pkField; 47 } 48 49 53 public String getName() { 54 return fieldName; 55 } 56 57 60 protected void setName(String fieldName) { 61 this.fieldName = fieldName; 62 } 63 64 67 protected void setPrimaryKey(boolean pkField) { 68 this.pkField = pkField; 69 } 70 71 74 public Class getFieldType() { 75 return fieldType; 76 } 77 78 81 protected void setFieldType(Class fieldType) { 82 this.fieldType = fieldType; 83 } 84 85 88 public static String getSetterName(String fieldName) { 89 return "set" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); 90 } 91 92 95 public static String getGetterName(String fieldName) { 96 return "get" + Character.toUpperCase(fieldName.charAt(0)) + fieldName.substring(1); 97 } 98 99 103 public String toString() { 104 StringBuffer ret = new StringBuffer (); 105 ret.append("\ngetName() = " + getName()); 106 ret.append("\ngetFieldType() = " + getFieldType()); 107 ret.append("\nisPrimaryKey() = " + isPrimaryKey()); 108 return ret.toString(); 109 } 110 111 } 112 | Popular Tags |