Package org.forgerock.opendj.config
Class RelativeInheritedDefaultBehaviorProvider<T>
- java.lang.Object
-
- org.forgerock.opendj.config.DefaultBehaviorProvider<T>
-
- org.forgerock.opendj.config.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
Constructors Constructor Description RelativeInheritedDefaultBehaviorProvider(AbstractManagedObjectDefinition<?,?> d, String propertyName, int offset)
Create a relative inherited default behavior provider associated with a parent managed object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <R,P>
Raccept(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.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.forgerock.opendj.config.DefaultBehaviorProvider
initialize
-
-
-
-
Constructor Detail
-
RelativeInheritedDefaultBehaviorProvider
public RelativeInheritedDefaultBehaviorProvider(AbstractManagedObjectDefinition<?,?> d, String propertyName, int offset)
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:
IllegalArgumentException
- If the offset is less than 0.
-
-
Method Detail
-
accept
public <R,P> R accept(DefaultBehaviorProviderVisitor<T,R,P> v, P p)
Description copied from class:DefaultBehaviorProvider
Apply a visitor to this default behavior provider.- Specified by:
accept
in classDefaultBehaviorProvider<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 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).
-
-