1 2 package descriptor; 3 4 public abstract class AttributeDescriptor { 5 protected AttributeDescriptor(String column, Class cls,int type){ 6 System.out.println("Call " + getClass().getName() + " 01"); 7 } 8 protected AttributeDescriptor(String column, Class cls,Class type){ 9 System.out.println("Call " + getClass().getName() + " 02"); 10 } 11 protected AttributeDescriptor(String column, Class cls,Class user,Class remoteUser){ 12 System.out.println("Call " + getClass().getName() + " 03"); 13 } 14 public static AttributeDescriptor forInteger(String column, Class cls){ 15 return new DefaultDescriptor(column,cls,Integer.TYPE); 16 } 17 public static AttributeDescriptor forDate(String column, Class cls){ 18 return new DefaultDescriptor(column,cls,Date.class); 19 } 20 public static AttributeDescriptor forReference(String column, Class cls){ 21 return new ReferenceDescriptor(column, cls, User.class, RemoteUser.class); 22 } 23 } 24 25 class Integer { 26 public static int TYPE = 0; 27 } 28 29 class Date { 30 } 31 32 class User { 33 } 34 35 class RemoteUser { 36 }