Skip to content
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

[doc] How to implement a custom XPath function for a language #4807

Open
adangel opened this issue Jan 25, 2024 · 0 comments
Open

[doc] How to implement a custom XPath function for a language #4807

adangel opened this issue Jan 25, 2024 · 0 comments
Labels
an:enhancement An improvement on existing features / rules in:documentation Affects the documentation

Comments

@adangel
Copy link
Member

adangel commented Jan 25, 2024

PMD provides a couple of custom XPath functions, that can be called, see
https://docs.pmd-code.org/latest/pmd_userdocs_extending_writing_xpath_rules.html#pmd-extension-functions

However, there is no documentation available yet, that describes, how to implement/add such a custom function for your own language or for existing languages.
It should be added e.g. here https://docs.pmd-code.org/snapshot/pmd_devdocs_major_adding_new_language_javacc.html#xpath-integration

Important classes:

  • net.sourceforge.pmd.lang.rule.xpath.impl.XPathHandler
  • net.sourceforge.pmd.lang.rule.xpath.impl.XPathFunctionDefinition

Related issues:

@adangel adangel added an:enhancement An improvement on existing features / rules in:documentation Affects the documentation labels Jan 25, 2024
@adangel adangel mentioned this issue Jan 25, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
an:enhancement An improvement on existing features / rules in:documentation Affects the documentation
Projects
None yet
Development

No branches or pull requests

1 participant