Share via


Selecting By Field

Field rules are qualified by type rules, so they appear in the rules view as children of type nodes. A field rule will select all fields (in all types matched by the parent type rule) that match your criteria. Supported matching criteria include field name and field attributes.

Field Name

You create a field rule by right clicking on the parent type rule’s node and selecting “Add Field”, then typing a name in the Name field. The name will be interpreted as a regular expression if the “Regular Expression” checkbox is checked; otherwise the name will be interpreted literally.

Field Attribute Specifier

In addition to field name, you can also select based on field attribute specifiers, using the values provided in the "Attribute Specifier" list box. A ‘-‘ preceding an attribute specifier negates the attribute (i.e. it selects all fields that do not have the specified attribute). You can select multiple attributes from the list; the criteria implied by multiple selections are logically ANDed together (that is, the set of selected fields is the intersection of all fields that match each attribute specifier.). For example, you can select fields that are both public and static by selecting “+public” and “+static” from the list.

The attribute specifications are logically ANDed with the field name, so if you want to select all fields with a specific set of attributes, you need to provide a regular expression for the field name that selects all fields (i.e. “.*”).

Field Rule Node

The corresponding field node displayed in the rule editing view has a child element that indicates whether the rule is a regular expression and whether the rule has attribute specifiers. You can preview the fields selected by the rule by right clicking on the node and selecting the preview option from the menu.

In the screen shot, a field rule is defined that selects the names of all fields (in all types) whose names start with “my”.

© 2002-2007 PreEmptive Solutions. All rights reserved.