1 import java.util.ArrayList; 2 import java.util.Iterator; 3 import java.util.List; 4 import descriptor.*; 5 6 public class Main { 7 public static void main(String[] args){ 8 Main main = new Main(); 9 List list = main.createAttributeDescriptors(); 10 Iterator it = list.iterator(); 11 while(it.hasNext()){ 12 System.out.println("class name is : " + it.next().getClass().getName()); 13 } 14 } 15 16 public List createAttributeDescriptors(){ 17 List result = new ArrayList(); 18 19 result.add(new DefaultDescriptor("remoteId", getClass(), Integer.TYPE)); 20 result.add(new DefaultDescriptor("createDate", getClass(), Date.class)); 21 result.add(new DefaultDescriptor("lastChangeDate", getClass(), Date.class)); 22 result.add(new ReferenceDescriptor("createdBy", getClass(), User.class, RemoteUser.class)); 23 result.add(new ReferenceDescriptor("lastChangedBy", getClass(), User.class, RemoteUser.class)); 24 result.add(new DefaultDescriptor("optimisticLockVersion", getClass(), Integer.TYPE)); 25 26 return result; 27 } 28 } 29 30 class Integer { 31 public static int TYPE = 0; 32 } 33 34 class Date { 35 } 36 37 class User { 38 } 39 40 class RemoteUser { 41 } 42