org.opends.server.admin
Class RelativeInheritedDefaultBehaviorProvider<T>

java.lang.Object
  extended by org.opends.server.admin.DefaultBehaviorProvider<T>
      extended by org.opends.server.admin.RelativeInheritedDefaultBehaviorProvider<T>
Type Parameters:
T - The type of values represented by this provider.

public final class RelativeInheritedDefaultBehaviorProvider<T>
extends DefaultBehaviorProvider<T>

A default behavior provider which retrieves default values from a parent managed object. It should be used by properties which inherit their default value(s) from properties held in an other managed object.


Constructor Summary
RelativeInheritedDefaultBehaviorProvider(AbstractManagedObjectDefinition<?,?> d, java.lang.String propertyName, int offset)
          Create a relative inherited default behavior provider associated with a parent managed object.
 
Method Summary
<R,P> R
accept(DefaultBehaviorProviderVisitor<T,R,P> v, P p)
          Apply a visitor to this default behavior provider.
 AbstractManagedObjectDefinition<?,?> getManagedObjectDefinition()
          Get the definition of the parent managed object containing the inherited default values.
 ManagedObjectPath<?,?> getManagedObjectPath(ManagedObjectPath<?,?> path)
          Get the absolute path of the managed object containing the property which has the default values.
 java.lang.String getPropertyName()
          Gets the name of the property containing the inherited default values.
 int getRelativeOffset()
          Get the relative location of the parent managed object.
 
Methods inherited from class org.opends.server.admin.DefaultBehaviorProvider
initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelativeInheritedDefaultBehaviorProvider

public RelativeInheritedDefaultBehaviorProvider(AbstractManagedObjectDefinition<?,?> d,
                                                java.lang.String propertyName,
                                                int offset)
                                         throws java.lang.IllegalArgumentException
Create a relative inherited default behavior provider associated with a parent managed object.

Parameters:
d - The type of parent managed object expected at the relative location.
propertyName - The name of the property containing the inherited default values.
offset - The relative location of the parent managed object (where 0 is the managed object itself, 1 is the parent, and 2 is the grand-parent).
Throws:
java.lang.IllegalArgumentException - If the offset is less than 0.
Method Detail

accept

public <R,P> R accept(DefaultBehaviorProviderVisitor<T,R,P> v,
                      P p)
Apply a visitor to this default behavior provider.

Specified by:
accept in class DefaultBehaviorProvider<T>
Type Parameters:
R - The return type of the visitor's methods.
P - The type of the additional parameters to the visitor's methods.
Parameters:
v - The default behavior visitor.
p - Optional additional visitor parameter.
Returns:
Returns a result as specified by the visitor.

getManagedObjectDefinition

public AbstractManagedObjectDefinition<?,?> getManagedObjectDefinition()
Get the definition of the parent managed object containing the inherited default values.

Returns:
Returns the definition of the parent managed object containing the inherited default values.

getManagedObjectPath

public ManagedObjectPath<?,?> getManagedObjectPath(ManagedObjectPath<?,?> path)
Get the absolute path of the managed object containing the property which has the default values.

Parameters:
path - The path of the current managed object from which the relative path should be determined.
Returns:
Returns the absolute path of the managed object containing the property which has the default values.

getPropertyName

public java.lang.String getPropertyName()
Gets the name of the property containing the inherited default values.

Returns:
Returns the name of the property containing the inherited default values.

getRelativeOffset

public int getRelativeOffset()
Get the relative location of the parent managed object.

Returns:
Returns the relative location of the parent managed object (where 0 is the managed object itself, 1 is the parent, and 2 is the grand-parent).