/** * Checks whether this property descriptor is defined for this property source. * * @param propertyDescriptor The property descriptor to check */ private void checkValidPropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) { if (!hasDescriptor(propertyDescriptor)) { throw new IllegalArgumentException("Property descriptor not defined for " + getPropertySourceType() + " " + getName() + ": " + propertyDescriptor); } }
@Override public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) { // Check to ensure the property does not already exist. if (getPropertyDescriptor(propertyDescriptor.name()) != null) { throw new IllegalArgumentException("There is already a PropertyDescriptor with name '" + propertyDescriptor.name() + "' defined on " + getPropertySourceType() + " " + getName() + "."); } propertyDescriptors.add(propertyDescriptor); // Sort in UI order Collections.sort(propertyDescriptors); }
/** * Checks whether this property descriptor is defined for this property source. * * @param propertyDescriptor The property descriptor to check */ private void checkValidPropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) { if (!hasDescriptor(propertyDescriptor)) { throw new IllegalArgumentException("Property descriptor not defined for " + getPropertySourceType() + " " + getName() + ": " + propertyDescriptor); } }
@Override public void definePropertyDescriptor(PropertyDescriptor<?> propertyDescriptor) { // Check to ensure the property does not already exist. if (getPropertyDescriptor(propertyDescriptor.name()) != null) { throw new IllegalArgumentException("There is already a PropertyDescriptor with name '" + propertyDescriptor.name() + "' defined on " + getPropertySourceType() + " " + getName() + "."); } propertyDescriptors.add(propertyDescriptor); // Sort in UI order Collections.sort(propertyDescriptors); }