| | |
| | | /** |
| | | * An interface for incrementally constructing DN property definitions. |
| | | */ |
| | | public static class Builder extends AbstractBuilder<DN, DNPropertyDefinition> { |
| | | public static final class Builder extends AbstractBuilder<DN, DNPropertyDefinition> { |
| | | |
| | | // Optional base DN which all valid values must be immediately |
| | | // subordinate to. |
| | |
| | | * If the provided string is not a valid DN string |
| | | * representation. |
| | | */ |
| | | public void setBaseDN(String baseDN) throws IllegalArgumentException { |
| | | public void setBaseDN(String baseDN) { |
| | | if (baseDN == null) { |
| | | setBaseDN((DN) null); |
| | | } else { |
| | |
| | | */ |
| | | @Override |
| | | protected DNPropertyDefinition buildInstance(AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<DN> defaultBehavior) { |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<DN> defaultBehavior) { |
| | | return new DNPropertyDefinition(d, propertyName, options, adminAction, defaultBehavior, baseDN); |
| | | } |
| | | } |
| | |
| | | |
| | | // Private constructor. |
| | | private DNPropertyDefinition(AbstractManagedObjectDefinition<?, ?> d, String propertyName, |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<DN> defaultBehavior, DN baseDN) { |
| | | EnumSet<PropertyOption> options, AdministratorAction adminAction, |
| | | DefaultBehaviorProvider<DN> defaultBehavior, DN baseDN) { |
| | | super(d, DN.class, propertyName, options, adminAction, defaultBehavior); |
| | | this.baseDN = baseDN; |
| | | } |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public void validateValue(DN value) throws IllegalPropertyValueException { |
| | | public void validateValue(DN value) { |
| | | Reject.ifNull(value); |
| | | |
| | | if (baseDN != null) { |
| | |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override |
| | | public DN decodeValue(String value) throws IllegalPropertyValueStringException { |
| | | public DN decodeValue(String value) { |
| | | Reject.ifNull(value); |
| | | |
| | | try { |