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); }
public SimpleIndexedPropertyDescriptor(IndexedPropertyDescriptor original) throws IntrospectionException { this( original.getName(), original.getReadMethod(), original.getWriteMethod(), original.getIndexedReadMethod(), original.getIndexedWriteMethod()); PropertyDescriptorUtils.copyNonMethodProperties(original, this); }
@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; }
/* * 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)); }
@Override public boolean equals(Object other) { return (this == other || (other instanceof PropertyDescriptor && PropertyDescriptorUtils.equals(this, (PropertyDescriptor) other))); }