1 19 20 package org.netbeans.modules.j2ee.dd.impl.common; 21 22 import org.netbeans.modules.schema2beans.BaseBean; 23 import org.netbeans.modules.schema2beans.BaseProperty; 24 import org.netbeans.modules.j2ee.dd.api.web.*; 25 26 31 public class Comparator extends org.netbeans.modules.schema2beans.BeanComparator 32 { 33 public BaseBean compareBean(String beanName, 34 BaseBean curBean, 35 BaseBean newBean) { 36 if (curBean!=null && newBean!= null) { 37 if (curBean instanceof EnclosingBean && newBean instanceof EnclosingBean) { 38 if (((EnclosingBean) curBean).getOriginal() == ((EnclosingBean) newBean).getOriginal()) { 39 return curBean; 40 } 41 } 42 if (curBean instanceof KeyBean) { 43 String prop = ((KeyBean) curBean).getKeyProperty(); 44 Object key1 = curBean.getValue(prop); 45 Object key2 = newBean.getValue(prop); 46 if (key1 != null) { 47 if (key1.equals(key2)) { 48 return curBean; 49 } 50 } 51 } else { 52 if (beanName.equals("SessionConfig")) { return curBean; 54 } else if (beanName.equals("WelcomeFileList")) { return curBean; 56 } else if (beanName.equals("LoginConfig")) { return curBean; 58 } else if (beanName.equals("FormLoginConfig")) { return curBean; 60 } else if (beanName.equals("FilterMapping")) { return curBean; 62 } else if (beanName.equals("Listener")) { return curBean; 64 } else if (beanName.equals("RunAs")) { return curBean; 66 } else if (beanName.equals("AuthConstraint")) { return curBean; 68 } else if (beanName.equals("UserDataConstraint")) { return curBean; 70 } else if (beanName.equals("JspConfig")) { return curBean; 72 } else if (beanName.equals("JspPropertyGroup")) { return curBean; 74 } else if (beanName.equals("LocaleEncodingMappingList")) { return curBean; 76 } 77 } 78 } 79 return super.compareBean(beanName, curBean, newBean); 80 } 81 82 public Object compareProperty(String propertyName, 83 BaseBean curBean, 84 Object curValue, 85 int curIndex, 86 BaseBean newBean, 87 Object newValue, 88 int newIndex) { 89 return super.compareProperty(propertyName, curBean,curValue,curIndex,newBean,newValue, newIndex); 90 } 91 } 92 | Popular Tags |