typeMatch

Parent Previous Next

typeMatch


The typeMatch attribute has different functionality depending on which node the typeMatch attribute is used alongside. When used within the StructureMap node, the typeMatch is used by DOC xPress during document generation to match the Structure Map to a regular expression based on each of the root object types present within the solution layout. When present within Rule node, the typeMatch attribute is used to implicitly match all objects within the Structure Map to a regular expression based on the object's type. If both nameMatch and typeMatch are included within the Rule, then both nameMatch and typeMatch must match for the rule to be applied.


Syntax

This structure map matches to all object types that fit the Regular Expression string "Microsoft\.SqlServer\.Management\.Smo\.Server" and creates an empty structure with no nodes as well as implicitly maps all templates to the template "GlobalDefault":


<StructureMap typeMatch="Microsoft\.SqlServer\.Management\.Smo\.Server">

<Structure>

</Structure>

<Rules>

<Rule templateKey="GlobalDefault" />

</Rules>

</StructureMap>



This rule will implicitly map all objects with an object name that matches the regular expression string "Credentials$" and an object type that matches the regular expression string "Smo\.CredentialsCollection$" to the template mapped to the key "SqlCredentialsCollection":


<Rule templateKey="SqlCredentialsCollection" nameMatch="Credentials$" typeMatch="Smo\.CredentialsCollection$" />



Associated Required Nodes

StructureMap - Used to encapsulate the entire Structure Map and contains the typeMatch attribute, which matches all of a solution's root objects types to their respected structure map.


Associated Optional Nodes

Rule - Used to specify a single rule for implicitly associating objects of a specific name and/or type with a specific templateKey.