Sun Identity Manager Deployment Reference

Object Manipulation Expressions

Use the following functions to manipulate arbitrary object values within expressions.

get Function

Retrieves a value from within an object. The

first argument Must be a List, Map, or Object.

second argument– Must be a String or Integer. If the first argument is a List, the second argument is coerced to an integer and used as a list index. If the first argument is a GenericObject, the second argument is assumed to be the name of a JavaBean property.

The function behaves differently if the first argument is a list. If the first argument is a list, then the second argument is an integer list index. The element at that index is returned.

Example

This expression returns a string that is the name of the currently assigned role for the user.

<get>
   <!--List, Map, or Object -->
   <!-- String -->
</get>

This expression is equivalent to call userView.getRole() in Java code.

putmap Function

Assigns map elements to an object.

map– specifies the map.

key– specifies the map key.

value– specifies the value to assign to the map key.

Example

<putmap>
   <ref>userView</ref>
   <s>waveset.role</s>
   <s>engineering</s>
</putmap>

setlist Function

Assigns list elements to an object.

list– specifies the list

index– specifies the order of elements in the list

value– specifies the value to assign to the list element

Example

<setlist>
   <ref>myList</ref>
   <i>s</i>
   <s>accounts</s>
</setlist>

setvar Function

Set the value on the variable. This function accepts a static variable name.

name– identifies the name of the variable

value– specifies the value to assign to the variable

Example

<setvar>
   <ref>var</ref>
   <s>text</s>
</setvar>

instanceof

Identifies whether an object is an instance of the type specified in the name parameter.

name– identifies the object type you are checking against.

This function returns 1 or 0 (true or false) depending on whether the sub expression object is an instance of the type specified in the name parameter.

Example

The following expression returns 1 because ArrayList is a List

<instanceof name=’List’>
    <new class=’java.util.ArrayList’/>
</instanceof>