Class RegexpValueMatcher

java.lang.Object
com.adaptris.core.services.metadata.RegexpValueMatcher
All Implemented Interfaces:
MetadataValueMatcher

public class RegexpValueMatcher extends Object implements MetadataValueMatcher
Match the metadata value against a regular expression for MetadataValueBranchingService.

The key portion of the mappings is the regular expression; the value portion is the intended service id.

   
    <metadata-value-branching-service>
     <unique-id>CheckEmailDomain</unique-id>
     <metadata-key>MetadataKey_Containing_an_Email</metadata-key>
     <default-service-id>Not_Google_Apple_Microsoft</default-service-id>
     <value-matcher class="regex-value-matcher"/>
     <metadata-to-service-id-mappings>
      <key-value-pair>
       <key>.*google.com$</key>
       <value>FromGmail</value>
      </key-value-pair>
      <key-value-pair>
       <key>.*microsoft.com$</key>
       <value>FromMicrosoft</value>
      </key-value-pair>
      <key-value-pair>
       <key>.*apple.com$</key>
       <value>FromApple</value>
      </key-value-pair>
     </metadata-to-service-id-mappings>
    </metadata-value-branching-service>
   
   

In the adapter configuration file this class is aliased as regex-value-matcher which is the preferred alternative to the fully qualified classname when building your configuration.