-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit Visitor to a Particaular type #14
Comments
After looking through the code base, I'd like to add some more info. The work you have done on this is awesome. Keep up the good work. |
I think the includeType was a patch because some schemas have a massive amount of methods and in one case a user reported a problem with too many overloaded methods all named "visit". This param will instead generate methods with the prefix of visit plus the type name. If you provide a test case for the substitution groups then I could have a look. I need to better understand the requirement. Perhaps specifying a filter via xpath or similar might work. |
Revisiting this after updating the code a little. The current behavior is to generate a single Visitor interface with a visit method for each concrete bean. I can see adding some options to the plugin to further restrict the classes that we visit (and also traverse). I believe this could be done by simply filtering the outline that the plugin is given to remove any classes that we discover that shouldn't be included. I'm not sure how this filter would be expressed. If the schemas are large or external like the OGC schemas then it's possible that there isn't a naming convention so a filter based on the fully qualified name isn't suitable. The OGC schemas also aren't well suited to this use case since their schemas result in a generic class for operations like I think with a cleaner set of schemas, it could be possible to have the filter include only concrete types that are referenced from some base type via an XmlSeeAlso or similar. It's also worth considering if this option emits multiple visitors, one for each group of related types. |
I've implemented this in a local copy; I added |
@Warpten feel free to create a PR or drop a link to your implementation. |
is there a way to limit the visitor to a particular type?
I saw an IncludeType command line arg, but that doesn't take any arguments itself.
For example if you had something that contained a list of substitutionGroup it would be nice to have the visitor work on just that substitution group. not for every type in the schema.
The text was updated successfully, but these errors were encountered: