Package org.forgerock.opendj.rest2ldap
Class JsonPropertyMapper
- java.lang.Object
-
- org.forgerock.opendj.rest2ldap.PropertyMapper
-
- org.forgerock.opendj.rest2ldap.JsonPropertyMapper
-
public final class JsonPropertyMapper extends PropertyMapper
A property mapper which provides a mapping from a JSON value to an LDAP attribute having the JSON syntax.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonPropertyMapperdefaultJsonValue(Object defaultValue)Sets the default JSON value which should be substituted when the LDAP attribute is not found in the LDAP entry.JsonPropertyMapperdefaultJsonValues(Collection<?> defaultValues)Sets the default JSON values which should be substituted when the LDAP attribute is not found in the LDAP entry.TisMultiValued(boolean isMultiValued)Indicates that the LDAP attribute is multi-valued and should be represented in JSON using an array of values.TisRequired(boolean isRequired)Indicates that the LDAP attribute is mandatory and must be provided during create requests.JsonPropertyMapperjsonSchema(org.forgerock.json.JsonValue jsonSchema)Sets the JSON schema corresponding to this simple property mapper.static voidputWritabilityProperties(WritabilityPolicy writabilityPolicy, org.forgerock.json.JsonValue jsonSchema)StringtoString()Twritability(WritabilityPolicy policy)Indicates whether the LDAP attribute supports updates.
-
-
-
Method Detail
-
defaultJsonValue
public JsonPropertyMapper defaultJsonValue(Object defaultValue)
Sets the default JSON value which should be substituted when the LDAP attribute is not found in the LDAP entry.- Parameters:
defaultValue- The default JSON value.- Returns:
- This property mapper.
-
defaultJsonValues
public JsonPropertyMapper defaultJsonValues(Collection<?> defaultValues)
Sets the default JSON values which should be substituted when the LDAP attribute is not found in the LDAP entry.- Parameters:
defaultValues- The default JSON values.- Returns:
- This property mapper.
-
jsonSchema
public JsonPropertyMapper jsonSchema(org.forgerock.json.JsonValue jsonSchema)
Sets the JSON schema corresponding to this simple property mapper. If notnull, it will be returned bytoJsonSchema(), otherwise a default JSON schema will be automatically generated with the information available in this property mapper.- Parameters:
jsonSchema- the JSON schema corresponding to this simple property mapper. Can benull- Returns:
- This property mapper.
-
isRequired
public final T isRequired(boolean isRequired)
Indicates that the LDAP attribute is mandatory and must be provided during create requests.- Parameters:
isRequired-trueif this property is required.- Returns:
- This property mapper.
-
isMultiValued
public final T isMultiValued(boolean isMultiValued)
Indicates that the LDAP attribute is multi-valued and should be represented in JSON using an array of values.- Parameters:
isMultiValued-trueif this property is multi-valued.- Returns:
- This property mapper.
-
writability
public final T writability(WritabilityPolicy policy)
Indicates whether the LDAP attribute supports updates. The default isWritabilityPolicy.READ_WRITE.- Parameters:
policy- The writability policy.- Returns:
- This property mapper.
-
putWritabilityProperties
public static void putWritabilityProperties(WritabilityPolicy writabilityPolicy, org.forgerock.json.JsonValue jsonSchema)
-
-