| | |
| | | private class DefaultValueFinder<T> implements |
| | | DefaultBehaviorProviderVisitor<T, Collection<T>, Void> { |
| | | |
| | | // Any exception that occurred whilst retrieving inherited default |
| | | // values. |
| | | /** Any exception that occurred whilst retrieving inherited default values. */ |
| | | private PropertyException exception; |
| | | |
| | | // The path of the managed object containing the first property. |
| | | /** The path of the managed object containing the first property. */ |
| | | private final ManagedObjectPath<?, ?> firstPath; |
| | | |
| | | // Indicates whether the managed object has been created yet. |
| | | /** Indicates whether the managed object has been created yet. */ |
| | | private final boolean isCreate; |
| | | |
| | | // The path of the managed object containing the next property. |
| | | /** The path of the managed object containing the next property. */ |
| | | private ManagedObjectPath<?, ?> nextPath; |
| | | |
| | | // The next property whose default values were required. |
| | | /** The next property whose default values were required. */ |
| | | private PropertyDefinition<T> nextProperty; |
| | | |
| | | |
| | | |
| | | // Private constructor. |
| | | /** Private constructor. */ |
| | | private DefaultValueFinder(ManagedObjectPath<?, ?> p, boolean isCreate) { |
| | | this.firstPath = p; |
| | | this.isCreate = isCreate; |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitAbsoluteInherited( |
| | | AbsoluteInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitAlias(AliasDefaultBehaviorProvider<T> d, Void p) { |
| | | return Collections.emptySet(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitDefined(DefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | | Collection<String> stringValues = d.getDefaultValues(); |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitRelativeInherited( |
| | | RelativeInheritedDefaultBehaviorProvider<T> d, Void p) { |
| | | try { |
| | |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | /** {@inheritDoc} */ |
| | | public Collection<T> visitUndefined(UndefinedDefaultBehaviorProvider<T> d, |
| | | Void p) { |
| | | return Collections.emptySet(); |
| | |
| | | |
| | | |
| | | |
| | | // Find the default values for the next path/property. |
| | | /** Find the default values for the next path/property. */ |
| | | private Collection<T> find(ManagedObjectPath<?, ?> p, |
| | | PropertyDefinition<T> pd) throws PropertyException { |
| | | this.nextPath = p; |
| | |
| | | |
| | | |
| | | |
| | | // Get an inherited property value. |
| | | /** Get an inherited property value. */ |
| | | @SuppressWarnings("unchecked") |
| | | private Collection<T> getInheritedProperty(ManagedObjectPath target, |
| | | AbstractManagedObjectDefinition<?, ?> d, String propertyName) |
| | |
| | | |
| | | |
| | | |
| | | // Remove a managed object, first ensuring that the parent exists, |
| | | // then ensuring that the child exists, before ensuring that any |
| | | // constraints are satisfied. |
| | | /** |
| | | * Remove a managed object, first ensuring that the parent exists, |
| | | * then ensuring that the child exists, before ensuring that any |
| | | * constraints are satisfied. |
| | | */ |
| | | private <C extends ConfigurationClient, S extends Configuration> |
| | | boolean doDeleteManagedObject( |
| | | ManagedObjectPath<C, S> path) throws ManagedObjectNotFoundException, |