220 likes | 346 Vues
Discover practical examples of using structural search with RegEx in Guidewire Software. Ted M. Young showcases how to refine searches to find specific code implementations like IQueryFilter and other requirements. This guide addresses common issues such as excessive results and the challenges of understanding class hierarchies. Learn to customize template edit variables to achieve better search outcomes while restricting results by visibility. Ideal for developers looking to enhance their coding efficiency in complex software environments.
E N D
Structural Search: Two Examples Ted M. Young http://about.me/tedmyoung Polyglot Coder in Labs Guidewire Software
Use RegEx! Does not understand class hierarchy
Find Usages? Too many results: want to restrict by visibility
Simple example… Find only direct implementors
Find IQueryFilter Implementers • Only public, static, concrete classes • Not abstract, not private
Structural Search Template • Look for: public, static implementations
The "OuterClass" Variable • Nothing special here, we "don't care"
The "Class" Variable Scripting Target
Script Constraints • Want classes that don't have the "abstract" modifier • Warning: not well documented!
The "Interface" Variable • Looking for IQueryFilter implementations
Text Constraints • Want IQueryFiltersubinterfaces and subclasses as well (i.e., the type hierarchy)
That's All Folks! Ted M. Young http://about.me/tedmyoung