@ThreadSafety(level=INTERFACE_THREADSAFE) public interface ValueConstructor
ServerContext.createValueConstructor(java.lang.String)
.
If a value template references multiple attributes, at most one may be multivalued. If one attribute is multivalued then the returned value will be multivalued with the same number of values. For example a template of '{givenName} {sn}' would produce values ['Jim Smith', 'James Smith'] if givenName had values of ['Jim', 'James'] and sn had a value of 'Smith'. If the source entry has no value or if there are multiple multivalued attributes, the attribute value construction will fail.
To include a '{' in the constructed value (when constructing JSON for instance) use '{{' in the value-pattern. Likewise, '}}' will result in '}' in the value pattern.
Pattern pattern = Pattern.compile(regex, flagsMask); Matcher matcher = pattern.matcher(attributeValueInput); String substitutionValueOutput = matcher.replaceFirst(replacement);
The modifiers are:
Modifier and Type | Method and Description |
---|---|
java.util.List<java.lang.String> |
constructValues(Entry entry)
Returns a list of values constructed using the value template that was
used to create this ValueConstructor substituting attribute values from
the provided entry where they appear in the value template.
|
java.util.List<java.lang.String> |
constructValues(Entry entry)
Returns a list of values constructed using the value template that was
used to create this ValueConstructor substituting attribute values from
the provided entry where they appear in the value template.
|
java.util.List<java.lang.String> constructValues(Entry entry) throws LDAPException
entry
- Attributes referenced in the value template are pulled from
this entry.LDAPException
- If the provided entry does not include values for
all attributes that appear in the value template;
if the value template includes regular expressions
for extracting portions of an attribute value, and
the attribute value does not match the regular
expression; or if the value template references
multiple attributes that have more than one value.java.util.List<java.lang.String> constructValues(Entry entry) throws LDAPException
entry
- Attributes referenced in the value template are pulled from
this entry.LDAPException
- If the provided entry does not include values for
all attributes that appear in the value template;
if the value template includes regular expressions
for extracting portions of an attribute value, and
the attribute value does not match the regular
expression; or if the value template references
multiple attributes that have more than one value.