Package org.forgerock.opendj.config
Class PropertyValueVisitor<R,P>
java.lang.Object
org.forgerock.opendj.config.PropertyValueVisitor<R,P>
- Type Parameters:
R
- The return type of this visitor's methods. UseVoid
for visitors that do not need to return results.P
- The type of the additional parameter to this visitor's methods. UseVoid
for visitors that do not need an additional parameter.
A visitor of property values, in the style of the visitor design pattern.
Classes implementing this interface can query a property a value and its
associated property definition in a type-safe manner when the kind of
property value is unknown at compile time. When a visitor is passed to a
property definition's accept method, the corresponding visit method most
applicable to that property definition is invoked.
Each visitXXX
method is provided with a default implementation
which calls visitUnknown(PropertyDefinition, ValueOrExpression, Object)
.
Sub-classes can override any or all of the methods to provide their own
type-specific behavior.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvisitAci
(AciPropertyDefinition pd, ValueOrExpression<String> v, P p) Visit a dseecompat ACI.<C extends ConfigurationClient,
S extends Configuration>
RvisitAggregation
(AggregationPropertyDefinition<C, S> pd, ValueOrExpression<String> v, P p) Visit an aggregation property value.Visit an attribute type.Visit a boolean.visitClass
(ClassPropertyDefinition pd, ValueOrExpression<String> v, P p) Visit a class.visitDn
(DnPropertyDefinition pd, ValueOrExpression<Dn> v, P p) Visit a DN.Visit a duration.visitEnum
(EnumPropertyDefinition<E> pd, ValueOrExpression<E> v, P p) Visit an enumeration.visitHost
(HostPropertyDefinition pd, ValueOrExpression<com.forgerock.opendj.util.Host> v, P p) Visit a host.visitHostPort
(HostPortPropertyDefinition pd, ValueOrExpression<com.forgerock.opendj.util.HostPort> v, P p) Visit a host:port.Visit an integer.Visit a IP address mask.visitSize
(SizePropertyDefinition pd, ValueOrExpression<Long> v, P p) Visit a size.visitString
(StringPropertyDefinition pd, ValueOrExpression<String> v, P p) Visit a string.<T> R
visitUnknown
(PropertyDefinition<T> pd, ValueOrExpression<T> v, P p) Visit an unknown type of property value.
-
Constructor Details
-
PropertyValueVisitor
protected PropertyValueVisitor()Default constructor.
-
-
Method Details
-
visitAci
Visit a dseecompat ACI.- Parameters:
pd
- The dseecompat ACI property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitAggregation
public <C extends ConfigurationClient,S extends Configuration> R visitAggregation(AggregationPropertyDefinition<C, S> pd, ValueOrExpression<String> v, P p) Visit an aggregation property value.- Type Parameters:
C
- The type of client managed object configuration that this aggregation property definition refers to.S
- The type of server managed object configuration that this aggregation property definition refers to.- Parameters:
pd
- The aggregation property definition to visit.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitAttributeType
public R visitAttributeType(AttributeTypePropertyDefinition pd, ValueOrExpression<AttributeType> v, P p) Visit an attribute type.- Parameters:
pd
- The attribute type property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitBoolean
Visit a boolean.- Parameters:
pd
- The boolean property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitClass
Visit a class.- Parameters:
pd
- The class property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitDn
Visit a DN.- Parameters:
pd
- The DN property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitDuration
Visit a duration.- Parameters:
pd
- The duration property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitEnum
Visit an enumeration.- Type Parameters:
E
- The enumeration that should be used for values of the property definition.- Parameters:
pd
- The enumeration property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitInteger
Visit an integer.- Parameters:
pd
- The integer property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitHost
public R visitHost(HostPropertyDefinition pd, ValueOrExpression<com.forgerock.opendj.util.Host> v, P p) Visit a host.- Parameters:
pd
- The host property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitHostPort
public R visitHostPort(HostPortPropertyDefinition pd, ValueOrExpression<com.forgerock.opendj.util.HostPort> v, P p) Visit a host:port.- Parameters:
pd
- The host:port property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitIpAddressMask
public R visitIpAddressMask(IpAddressMaskPropertyDefinition pd, ValueOrExpression<AddressMask> v, P p) Visit a IP address mask.- Parameters:
pd
- The IP address mask property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitSize
Visit a size.- Parameters:
pd
- The size property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitString
Visit a string.- Parameters:
pd
- The string property definition.v
- The property value to visit.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
-
visitUnknown
Visit an unknown type of property value. Implementations of this method can provide default behavior for unknown types of property.The default implementation of this method throws an
PropertyException
. Sub-classes can override this method with their own default behavior.- Type Parameters:
T
- The type of property value to visit.- Parameters:
pd
- The property definition.v
- The property value.p
- A visitor specified parameter.- Returns:
- Returns a visitor specified result.
- Throws:
PropertyException
- Visitor implementations may optionally throw this exception.
-