Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NameCardinalityDescription
<ReturnValue>
1The content is used as the output value if any of the source values match. Replacement rules from java.util.regex.Matcher.replaceAll(java.lang.String) apply.
<SourceValue>
1 or more

The content is matched against each input value and if it matches, then the the mapped <ReturnValue> is output. The The mapping process depends on the value of the partialMatch attribute (, which defaults to false) allows partial matches to be performed (any string which contains the pattern is a match). If partialMatchis false then the pattern is matched as a Java Regular Expression and all matches are .

If set to true, then the source value is checked for containment within the input value, and if so, the return value replaces the original.

If set to false, then the source value is a Java Regular Expression applied to the input value, and if a match, then the return value is applied as a replacement, with all matches replaced by the return value.

The ignoreCaseattribute (default false) allows case insensitive comparisons to be made. This is only valid for regular expression matching (i.e., if partialMatch is false).

Example

Code Block
languagexml
<AttributeDefinition id="mapped" xsi:type="Mapped" sourceAttributeID="uid">
    <Dependency ref="uid" />
    <DefaultValue passThru="true"/>
	<ValueMap>
		<ReturnValue>return1</ReturnValue>
		<SourceValue>sou.+rc.+e1</SourceValue>
		<SourceValue partialMatch="true" ignoreCase="true">fred</SourceValue>
	</ValueMap>
	<ValueMap>
		<ReturnValue>return1</ReturnValue>
		<SourceValue>source2</SourceValue>
	</ValueMap>
	<ValueMap>
		<ReturnValue>some_string_to_add_before_value:$1</ReturnValue>
		<SourceValue>(.+)</SourceValue>
	</ValueMap>
    <AttributeEncoder xsi:type="SAML2String" name="https://example.org/example/name" friendlyName="Mapped" encodeType="false" />
 </AttributeDefinition>