Пример #1
0
 public SimplePropertyDescriptor(String propertyName, Method readMethod, Method writeMethod)
     throws IntrospectionException {
   super(propertyName, null, null);
   this.readMethod = readMethod;
   this.writeMethod = writeMethod;
   this.propertyType = PropertyDescriptorUtils.findPropertyType(readMethod, writeMethod);
 }
Пример #2
0
 public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original)
     throws IntrospectionException {
   this(
       original.getName(),
       original.getReadMethod(),
       original.getWriteMethod(),
       original.getIndexedReadMethod(),
       original.getIndexedWriteMethod());
   PropertyDescriptorUtils.copyNonMethodProperties(original, this);
 }
Пример #3
0
 @Override
 public Class<?> getPropertyType() {
   if (this.propertyType == null) {
     try {
       this.propertyType =
           PropertyDescriptorUtils.findPropertyType(this.readMethod, this.writeMethod);
     } catch (IntrospectionException ex) {
       // Ignore, as does IndexedPropertyDescriptor#getPropertyType
     }
   }
   return this.propertyType;
 }
Пример #4
0
 /*
  * See java.beans.IndexedPropertyDescriptor#equals(java.lang.Object)
  */
 @Override
 public boolean equals(Object other) {
   if (this == other) {
     return true;
   }
   if (!(other instanceof IndexedPropertyDescriptor)) {
     return false;
   }
   IndexedPropertyDescriptor otherPd = (IndexedPropertyDescriptor) other;
   return (ObjectUtils.nullSafeEquals(getIndexedReadMethod(), otherPd.getIndexedReadMethod())
       && ObjectUtils.nullSafeEquals(getIndexedWriteMethod(), otherPd.getIndexedWriteMethod())
       && ObjectUtils.nullSafeEquals(getIndexedPropertyType(), otherPd.getIndexedPropertyType())
       && PropertyDescriptorUtils.equals(this, otherPd));
 }
Пример #5
0
 @Override
 public boolean equals(Object other) {
   return (this == other
       || (other instanceof PropertyDescriptor
           && PropertyDescriptorUtils.equals(this, (PropertyDescriptor) other)));
 }