Customizing Serialization with Class Pattern Strings

Use class pattern strings to name the classes that you want to serialize using GemFire's reflection-based autoserializer and to specify object identity fields and to specify fields to exclude from serialization.

The class pattern strings used to configured the ReflectionBasedAutoSerializer are standard regular expressions. For example, this expression would select all classes defined in the com.company.domain package and its subpackages:
com\.company\.domain\..*
You can augment the pattern strings with a special notation to define fields to exclude from serialization and to define fields to mark as PDX identity fields. The full syntax of the pattern string is:
<class pattern> [# (identity|exclude) = <field pattern>]... [, <class pattern>...]
The following example pattern string sets these PDX serialization criteria:
com.company.DomainObject.*#identity=id.*#exclude=creationDate, 
com.company.special.Patient#identity=ssn
Note: There is no association between the identity and exclude options, so the pattern above could also be expressed as:
com.company.DomainObject.*#identity=id.*, com.company.DomainObject.*#exclude=creationDate, 
com.company.special.Patient#identity=ssn
Note: The order of the patterns is not relevant. All defined class patterns are used when determining whether a field should be considered as an identity field or should be excluded.
Examples: